Commit 4a0ec3d
authored
Make ext/odbc default value handling more consistent (#13910)
These changes are carved off from https://github.com/php/php-src/pull/12040/files. I noticed that there are some inconsistencies between odbc_fetch_object()/odbc_fetch_array(), odbc_fetch_into(), as well as odbc_fetch_row(), specifically in how they handle the $row parameter. Now, I tried to align their behaviour the following way:
- I made null the default value. Previously, the default values were one of the following: -1, -1, 0, and null, respectively.
- odbc_fetch_row() has been returning false indicating there is no more rows when 0 is passed as $row. Now, a warning is also emitted in this case, because the null default value is not new, because it's available since PHP 8.0.
- When HAVE_SQL_EXTENDED_FETCH is not defined, the $row parameter is always ignored. Previously, some of the functions didn't accept it at all. Now a warning is emitted if the feature is not supported, but the parameter has any meaningful value (is greater than or equal to 1).1 parent 4d28e40 commit 4a0ec3d
File tree
5 files changed
+64
-42
lines changed- ext/odbc
- tests
5 files changed
+64
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
360 | 364 | | |
361 | 365 | | |
362 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
363 | 373 | | |
364 | 374 | | |
365 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | | - | |
| 358 | + | |
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | 364 | | |
365 | | - | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1269 | 1269 | | |
1270 | 1270 | | |
1271 | 1271 | | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
1272 | 1275 | | |
1273 | 1276 | | |
1274 | 1277 | | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
| 1278 | + | |
1278 | 1279 | | |
1279 | | - | |
| 1280 | + | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | 1283 | | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
| 1284 | + | |
1288 | 1285 | | |
1289 | 1286 | | |
1290 | | - | |
1291 | 1287 | | |
1292 | | - | |
1293 | | - | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1294 | 1293 | | |
| 1294 | + | |
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
| |||
1300 | 1300 | | |
1301 | 1301 | | |
1302 | 1302 | | |
1303 | | - | |
1304 | | - | |
| 1303 | + | |
| 1304 | + | |
1305 | 1305 | | |
1306 | 1306 | | |
1307 | 1307 | | |
| |||
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
1319 | | - | |
1320 | | - | |
| 1319 | + | |
| 1320 | + | |
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
| |||
1430 | 1430 | | |
1431 | 1431 | | |
1432 | 1432 | | |
1433 | | - | |
1434 | 1433 | | |
| 1434 | + | |
| 1435 | + | |
1435 | 1436 | | |
1436 | 1437 | | |
1437 | | - | |
1438 | 1438 | | |
1439 | 1439 | | |
1440 | | - | |
1441 | | - | |
| 1440 | + | |
1442 | 1441 | | |
1443 | 1442 | | |
1444 | 1443 | | |
1445 | | - | |
1446 | | - | |
1447 | | - | |
| 1444 | + | |
1448 | 1445 | | |
1449 | 1446 | | |
1450 | | - | |
1451 | 1447 | | |
1452 | | - | |
1453 | | - | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
1454 | 1453 | | |
| 1454 | + | |
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
| |||
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
1469 | | - | |
| 1468 | + | |
| 1469 | + | |
1470 | 1470 | | |
1471 | 1471 | | |
1472 | 1472 | | |
| |||
1479 | 1479 | | |
1480 | 1480 | | |
1481 | 1481 | | |
1482 | | - | |
1483 | | - | |
| 1482 | + | |
| 1483 | + | |
1484 | 1484 | | |
1485 | 1485 | | |
1486 | 1486 | | |
| |||
1560 | 1560 | | |
1561 | 1561 | | |
1562 | 1562 | | |
1563 | | - | |
1564 | | - | |
| 1563 | + | |
| 1564 | + | |
1565 | 1565 | | |
1566 | 1566 | | |
1567 | 1567 | | |
| |||
1575 | 1575 | | |
1576 | 1576 | | |
1577 | 1577 | | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
1578 | 1589 | | |
1579 | 1590 | | |
1580 | 1591 | | |
| |||
1594 | 1605 | | |
1595 | 1606 | | |
1596 | 1607 | | |
1597 | | - | |
| 1608 | + | |
1598 | 1609 | | |
1599 | 1610 | | |
1600 | | - | |
| 1611 | + | |
| 1612 | + | |
1601 | 1613 | | |
1602 | | - | |
1603 | 1614 | | |
1604 | 1615 | | |
1605 | 1616 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments