Commit b5454bd
committed
Fix: string and floats conversion fixes (#117)
* fix wide to C string conversion truncation indic.
In case of SQLWCHAR to SQLCHAR conversion the truncation indication
was wrongly signaled (the conversion was performed correctly, though).
This happened because of the wrong number of bytes compared against
available buffer: the SQLWCHAR string space instead of the (correct)
converted equivalent.
* added unit test for the fix
* fix: consider val 0 on dbl to float range check
- double zero will be less than FLT_MIN and still a valid float;
- double zero to integers conversions consider this case already and are
not affected.
(cherry picked from commit f6669dd)1 parent 963ccce commit b5454bd
File tree
4 files changed
+98
-28
lines changed- driver
- test
4 files changed
+98
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1332 | 1332 | | |
1333 | 1333 | | |
1334 | 1334 | | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1338 | 1340 | | |
1339 | 1341 | | |
1340 | 1342 | | |
| |||
1382 | 1384 | | |
1383 | 1385 | | |
1384 | 1386 | | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1385 | 1406 | | |
1386 | 1407 | | |
1387 | 1408 | | |
1388 | | - | |
1389 | | - | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
1390 | 1414 | | |
1391 | 1415 | | |
1392 | 1416 | | |
1393 | 1417 | | |
| 1418 | + | |
1394 | 1419 | | |
1395 | 1420 | | |
1396 | 1421 | | |
| |||
1404 | 1429 | | |
1405 | 1430 | | |
1406 | 1431 | | |
1407 | | - | |
1408 | | - | |
1409 | 1432 | | |
1410 | | - | |
1411 | 1433 | | |
1412 | 1434 | | |
1413 | 1435 | | |
| |||
1418 | 1440 | | |
1419 | 1441 | | |
1420 | 1442 | | |
1421 | | - | |
| 1443 | + | |
1422 | 1444 | | |
1423 | 1445 | | |
1424 | 1446 | | |
1425 | 1447 | | |
1426 | 1448 | | |
1427 | | - | |
1428 | | - | |
1429 | | - | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | 1449 | | |
1446 | 1450 | | |
1447 | 1451 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
| 776 | + | |
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
333 | 333 | | |
334 | 334 | | |
335 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
336 | 369 | | |
337 | 370 | | |
338 | 371 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
117 | 150 | | |
118 | 151 | | |
119 | 152 | | |
| |||
0 commit comments