Skip to content

Commit e08f691

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #80150: Failure to fetch error message
2 parents 1fafcd2 + df5efa2 commit e08f691

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ PHP NEWS
1818
. Fixed bug #78470 (odbc_specialcolumns() no longer accepts $nullable). (cmb)
1919
. Fixed bug #80147 (BINARY strings may not be properly zero-terminated).
2020
(cmb)
21+
. Fixed bug #80150 (Failure to fetch error message). (cmb)
2122

2223
- OPcache:
2324
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data

ext/odbc/php_odbc.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,7 +3155,7 @@ PHP_FUNCTION(odbc_tables)
31553155
type, SAFE_SQL_NTS(type));
31563156

31573157
if (rc == SQL_ERROR) {
3158-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTables");
3158+
odbc_sql_error(conn, result->stmt, "SQLTables");
31593159
efree(result);
31603160
RETURN_FALSE;
31613161
}
@@ -3226,7 +3226,7 @@ PHP_FUNCTION(odbc_columns)
32263226
column, (SQLSMALLINT) column_len);
32273227

32283228
if (rc == SQL_ERROR) {
3229-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumns");
3229+
odbc_sql_error(conn, result->stmt, "SQLColumns");
32303230
efree(result);
32313231
RETURN_FALSE;
32323232
}
@@ -3291,7 +3291,7 @@ PHP_FUNCTION(odbc_columnprivileges)
32913291
column, SAFE_SQL_NTS(column));
32923292

32933293
if (rc == SQL_ERROR) {
3294-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLColumnPrivileges");
3294+
odbc_sql_error(conn, result->stmt, "SQLColumnPrivileges");
32953295
efree(result);
32963296
RETURN_FALSE;
32973297
}
@@ -3371,7 +3371,7 @@ PHP_FUNCTION(odbc_foreignkeys)
33713371
ftable, SAFE_SQL_NTS(ftable) );
33723372

33733373
if (rc == SQL_ERROR) {
3374-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLForeignKeys");
3374+
odbc_sql_error(conn, result->stmt, "SQLForeignKeys");
33753375
efree(result);
33763376
RETURN_FALSE;
33773377
}
@@ -3433,7 +3433,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
34333433
rc = SQLGetTypeInfo(result->stmt, data_type );
34343434

34353435
if (rc == SQL_ERROR) {
3436-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLGetTypeInfo");
3436+
odbc_sql_error(conn, result->stmt, "SQLGetTypeInfo");
34373437
efree(result);
34383438
RETURN_FALSE;
34393439
}
@@ -3495,7 +3495,7 @@ PHP_FUNCTION(odbc_primarykeys)
34953495
table, SAFE_SQL_NTS(table) );
34963496

34973497
if (rc == SQL_ERROR) {
3498-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLPrimaryKeys");
3498+
odbc_sql_error(conn, result->stmt, "SQLPrimaryKeys");
34993499
efree(result);
35003500
RETURN_FALSE;
35013501
}
@@ -3564,7 +3564,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
35643564
col, SAFE_SQL_NTS(col) );
35653565

35663566
if (rc == SQL_ERROR) {
3567-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedureColumns");
3567+
odbc_sql_error(conn, result->stmt, "SQLProcedureColumns");
35683568
efree(result);
35693569
RETURN_FALSE;
35703570
}
@@ -3632,7 +3632,7 @@ PHP_FUNCTION(odbc_procedures)
36323632
proc, SAFE_SQL_NTS(proc) );
36333633

36343634
if (rc == SQL_ERROR) {
3635-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLProcedures");
3635+
odbc_sql_error(conn, result->stmt, "SQLProcedures");
36363636
efree(result);
36373637
RETURN_FALSE;
36383638
}
@@ -3705,7 +3705,7 @@ PHP_FUNCTION(odbc_specialcolumns)
37053705
nullable);
37063706

37073707
if (rc == SQL_ERROR) {
3708-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLSpecialColumns");
3708+
odbc_sql_error(conn, result->stmt, "SQLSpecialColumns");
37093709
efree(result);
37103710
RETURN_FALSE;
37113711
}
@@ -3775,7 +3775,7 @@ PHP_FUNCTION(odbc_statistics)
37753775
reserved);
37763776

37773777
if (rc == SQL_ERROR) {
3778-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLStatistics");
3778+
odbc_sql_error(conn, result->stmt, "SQLStatistics");
37793779
efree(result);
37803780
RETURN_FALSE;
37813781
}
@@ -3838,7 +3838,7 @@ PHP_FUNCTION(odbc_tableprivileges)
38383838
table, SAFE_SQL_NTS(table));
38393839

38403840
if (rc == SQL_ERROR) {
3841-
odbc_sql_error(conn, SQL_NULL_HSTMT, "SQLTablePrivileges");
3841+
odbc_sql_error(conn, result->stmt, "SQLTablePrivileges");
38423842
efree(result);
38433843
RETURN_FALSE;
38443844
}

0 commit comments

Comments
 (0)