- Notifications
You must be signed in to change notification settings - Fork5
Commit9305fc7
committed
Fixes:
Attached is a patch to allow libpq to determine if a field is null.This is needed because text fields will return a PQgetlength() of 0whether it is '' or NULL. There is even a comment in the source notingthe fact.I have changed the value of the 'len' field for NULL result fields. Ifthe field is null, the len is set to -1 (NULL_LEN). I have changedPQgetlength() to return a 0 length for both '' and NULL. A new functionPQgetisnull() returns true or false for NULL.The only risk is to applications that do not use the suggestedPQgetlength() call, but read the result 'len' field directly.As this is not recommended, I think we are safe here.A separate documentation patch will be sent.Submitted by: Bruce Momjian <maillist@candle.pha.pa.us>1 parent78d56d0 commit9305fc7
2 files changed
+38
-7
lines changedLines changed: 33 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
156 | 156 |
| |
157 | 157 |
| |
158 | 158 |
| |
159 |
| - | |
160 |
| - | |
161 | 159 |
| |
162 | 160 |
| |
163 |
| - | |
| 161 | + | |
164 | 162 |
| |
165 | 163 |
| |
166 | 164 |
| |
| |||
1469 | 1467 |
| |
1470 | 1468 |
| |
1471 | 1469 |
| |
1472 |
| - | |
1473 |
| - | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
1474 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + |
Lines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 |
| |
87 | 90 |
| |
88 | 91 |
| |
| |||
178 | 181 |
| |
179 | 182 |
| |
180 | 183 |
| |
| 184 | + | |
181 | 185 |
| |
182 | 186 |
| |
183 | 187 |
| |
|
0 commit comments
Comments
(0)