Skip to content

Commit 4669c53

Browse files
committed
Don't explicitly set return value on ZFR failure in ext/odbc
Failing `zend_fetch_resource(2)` throws as of PHP 8.0.0, so explicitly setting a return value is useless, and also slightly confusing.
1 parent e04eb28 commit 4669c53

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

ext/odbc/php_odbc.c

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
667667
}
668668

669669
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
670-
RETURN_FALSE;
670+
return;
671671
}
672672

673673
if (mode) {
@@ -805,7 +805,7 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type)
805805
}
806806

807807
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
808-
RETURN_FALSE;
808+
return;
809809
}
810810

811811
rc = SQLTransact(conn->henv, conn->hdbc, (SQLUSMALLINT)((type)?SQL_COMMIT:SQL_ROLLBACK));
@@ -852,7 +852,7 @@ void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
852852
}
853853

854854
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
855-
RETURN_FALSE;
855+
return;
856856
}
857857

858858
if (result->numcols == 0) {
@@ -947,7 +947,7 @@ PHP_FUNCTION(odbc_prepare)
947947
}
948948

949949
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
950-
RETURN_FALSE;
950+
return;
951951
}
952952

953953
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -1054,7 +1054,7 @@ PHP_FUNCTION(odbc_execute)
10541054
}
10551055

10561056
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1057-
RETURN_FALSE;
1057+
return;
10581058
}
10591059

10601060
/* XXX check for already bound parameters*/
@@ -1260,7 +1260,7 @@ PHP_FUNCTION(odbc_cursor)
12601260
}
12611261

12621262
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1263-
RETURN_FALSE;
1263+
return;
12641264
}
12651265

12661266
rc = SQLGetInfo(result->conn_ptr->hdbc,SQL_MAX_CURSOR_NAME_LEN, (void *)&max_len,sizeof(max_len),&len);
@@ -1326,7 +1326,7 @@ PHP_FUNCTION(odbc_data_source)
13261326
}
13271327

13281328
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(zv_conn), "ODBC-Link", le_conn, le_pconn))) {
1329-
RETURN_FALSE;
1329+
return;
13301330
}
13311331

13321332
/* now we have the "connection" lets call the DataSource object */
@@ -1384,7 +1384,7 @@ PHP_FUNCTION(odbc_exec)
13841384
}
13851385

13861386
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
1387-
RETURN_FALSE;
1387+
return;
13881388
}
13891389

13901390
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -1480,7 +1480,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
14801480
#endif
14811481

14821482
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1483-
RETURN_FALSE;
1483+
return;
14841484
}
14851485

14861486
if (result->numcols == 0) {
@@ -1632,7 +1632,7 @@ PHP_FUNCTION(odbc_fetch_into)
16321632
#endif /* HAVE_SQL_EXTENDED_FETCH */
16331633

16341634
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1635-
RETURN_FALSE;
1635+
return;
16361636
}
16371637

16381638
if (result->numcols == 0) {
@@ -1738,7 +1738,7 @@ PHP_FUNCTION(solid_fetch_prev)
17381738
}
17391739

17401740
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1741-
RETURN_FALSE;
1741+
return;
17421742
}
17431743
if (result->numcols == 0) {
17441744
php_error_docref(NULL, E_WARNING, "No tuples available at this result index");
@@ -1780,7 +1780,7 @@ PHP_FUNCTION(odbc_fetch_row)
17801780
rownum = pv_row;
17811781

17821782
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1783-
RETURN_FALSE;
1783+
return;
17841784
}
17851785

17861786
if (result->numcols == 0) {
@@ -1846,7 +1846,7 @@ PHP_FUNCTION(odbc_result)
18461846
}
18471847

18481848
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
1849-
RETURN_FALSE;
1849+
return;
18501850
}
18511851

18521852
if ((result->numcols == 0)) {
@@ -2025,7 +2025,7 @@ PHP_FUNCTION(odbc_result_all)
20252025
}
20262026

20272027
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2028-
RETURN_FALSE;
2028+
return;
20292029
}
20302030

20312031
if (result->numcols == 0) {
@@ -2142,7 +2142,7 @@ PHP_FUNCTION(odbc_free_result)
21422142
}
21432143

21442144
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2145-
RETURN_FALSE;
2145+
return;
21462146
}
21472147

21482148
if (result->values) {
@@ -2441,7 +2441,7 @@ PHP_FUNCTION(odbc_close)
24412441
}
24422442

24432443
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
2444-
RETURN_FALSE;
2444+
return;
24452445
}
24462446

24472447
if (Z_RES_P(pv_conn)->type == le_pconn) {
@@ -2478,7 +2478,7 @@ PHP_FUNCTION(odbc_num_rows)
24782478
}
24792479

24802480
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2481-
RETURN_FALSE;
2481+
return;
24822482
}
24832483

24842484
SQLRowCount(result->stmt, &rows);
@@ -2500,7 +2500,7 @@ PHP_FUNCTION(odbc_next_result)
25002500
}
25012501

25022502
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2503-
RETURN_FALSE;
2503+
return;
25042504
}
25052505

25062506
if (result->values) {
@@ -2551,7 +2551,7 @@ PHP_FUNCTION(odbc_num_fields)
25512551
}
25522552

25532553
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2554-
RETURN_FALSE;
2554+
return;
25552555
}
25562556

25572557
RETURN_LONG(result->numcols);
@@ -2571,7 +2571,7 @@ PHP_FUNCTION(odbc_field_name)
25712571
}
25722572

25732573
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2574-
RETURN_FALSE;
2574+
return;
25752575
}
25762576

25772577
if (result->numcols == 0) {
@@ -2608,7 +2608,7 @@ PHP_FUNCTION(odbc_field_type)
26082608
}
26092609

26102610
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2611-
RETURN_FALSE;
2611+
return;
26122612
}
26132613

26142614
if (result->numcols == 0) {
@@ -2661,7 +2661,7 @@ PHP_FUNCTION(odbc_field_num)
26612661
}
26622662

26632663
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_res), "ODBC result", le_result)) == NULL) {
2664-
RETURN_FALSE;
2664+
return;
26652665
}
26662666

26672667
if (result->numcols == 0) {
@@ -2698,7 +2698,7 @@ PHP_FUNCTION(odbc_autocommit)
26982698
}
26992699

27002700
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
2701-
RETURN_FALSE;
2701+
return;
27022702
}
27032703

27042704
if (ZEND_NUM_ARGS() > 1) {
@@ -2750,7 +2750,7 @@ static void php_odbc_lasterror(INTERNAL_FUNCTION_PARAMETERS, int mode)
27502750

27512751
if (ZEND_NUM_ARGS() == 1) {
27522752
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) {
2753-
RETURN_FALSE;
2753+
return;
27542754
}
27552755
if (mode == 0) {
27562756
ret = conn->laststate;
@@ -2808,7 +2808,7 @@ PHP_FUNCTION(odbc_setoption)
28082808
switch (pv_which) {
28092809
case 1: /* SQLSetConnectOption */
28102810
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_handle), "ODBC-Link", le_conn, le_pconn))) {
2811-
RETURN_FALSE;
2811+
return;
28122812
}
28132813

28142814
if (conn->persistent) {
@@ -2823,7 +2823,7 @@ PHP_FUNCTION(odbc_setoption)
28232823
break;
28242824
case 2: /* SQLSetStmtOption */
28252825
if ((result = (odbc_result *)zend_fetch_resource(Z_RES_P(pv_handle), "ODBC result", le_result)) == NULL) {
2826-
RETURN_FALSE;
2826+
return;
28272827
}
28282828

28292829
rc = SQLSetStmtOption(result->stmt, (unsigned short) pv_opt, pv_val);
@@ -2864,7 +2864,7 @@ PHP_FUNCTION(odbc_tables)
28642864
}
28652865

28662866
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
2867-
RETURN_FALSE;
2867+
return;
28682868
}
28692869

28702870
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -2933,7 +2933,7 @@ PHP_FUNCTION(odbc_columns)
29332933
}
29342934

29352935
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
2936-
RETURN_FALSE;
2936+
return;
29372937
}
29382938

29392939
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3005,7 +3005,7 @@ PHP_FUNCTION(odbc_columnprivileges)
30053005
}
30063006

30073007
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3008-
RETURN_FALSE;
3008+
return;
30093009
}
30103010

30113011
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3083,7 +3083,7 @@ PHP_FUNCTION(odbc_foreignkeys)
30833083
#endif
30843084

30853085
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3086-
RETURN_FALSE;
3086+
return;
30873087
}
30883088

30893089
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3151,7 +3151,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
31513151
data_type = (SQLSMALLINT) pv_data_type;
31523152

31533153
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3154-
RETURN_FALSE;
3154+
return;
31553155
}
31563156

31573157
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3210,7 +3210,7 @@ PHP_FUNCTION(odbc_primarykeys)
32103210
}
32113211

32123212
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3213-
RETURN_FALSE;
3213+
return;
32143214
}
32153215

32163216
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3278,7 +3278,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
32783278
}
32793279

32803280
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3281-
RETURN_FALSE;
3281+
return;
32823282
}
32833283

32843284
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3347,7 +3347,7 @@ PHP_FUNCTION(odbc_procedures)
33473347
}
33483348

33493349
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3350-
RETURN_FALSE;
3350+
return;
33513351
}
33523352

33533353
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3417,7 +3417,7 @@ PHP_FUNCTION(odbc_specialcolumns)
34173417
nullable = (SQLUSMALLINT) vnullable;
34183418

34193419
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3420-
RETURN_FALSE;
3420+
return;
34213421
}
34223422

34233423
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3488,7 +3488,7 @@ PHP_FUNCTION(odbc_statistics)
34883488
reserved = (SQLUSMALLINT) vreserved;
34893489

34903490
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3491-
RETURN_FALSE;
3491+
return;
34923492
}
34933493

34943494
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));
@@ -3553,7 +3553,7 @@ PHP_FUNCTION(odbc_tableprivileges)
35533553
}
35543554

35553555
if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(pv_conn), "ODBC-Link", le_conn, le_pconn))) {
3556-
RETURN_FALSE;
3556+
return;
35573557
}
35583558

35593559
result = (odbc_result *)ecalloc(1, sizeof(odbc_result));

0 commit comments

Comments
 (0)