summarylogtreecommitdiffstats
path: root/0006-Fix-duplicate-case.patch
blob: 90f6f3060d3335eacc3ba6d4b377b2b335b39278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- a/src/include/access/tupmacs.h
+++ b/src/include/access/tupmacs.h
@@ -61,11 +61,11 @@
 				return Int16GetDatum(*((const int16 *) T));
 			case sizeof(int32):
 				return Int32GetDatum(*((const int32 *) T));
+			default:
 #if SIZEOF_DATUM == 8
-			case sizeof(Datum):
+				if (attlen == sizeof(Datum))
 				return *((const Datum *) T);
 #endif
-			default:
 				elog(ERROR, "unsupported byval length: %d", attlen);
 				return 0;
 		}
@@ -193,12 +193,13 @@
 		case sizeof(int32):
 			*(int32 *) T = DatumGetInt32(newdatum);
 			break;
+		default:
 #if SIZEOF_DATUM == 8
-		case sizeof(Datum):
+			if (attlen == sizeof(Datum)) {
 			*(Datum *) T = newdatum;
-			break;
+				return;
+			}
 #endif
-		default:
 			elog(ERROR, "unsupported byval length: %d", attlen);
 	}
 }