if (dbh->query_stmt) {
RETURN_STRING(dbh->query_stmt->error_code, 1);
}
-
+
+ if (dbh->error_code[0] == '\0') {
+ RETURN_NULL();
+ }
+
+ // Fallback to default documented value
RETURN_STRING(dbh->error_code, 1);
}
/* }}} */
add_next_index_string(return_value, dbh->query_stmt->error_code, 1);
} else {
add_next_index_string(return_value, dbh->error_code, 1);
+ add_next_index_null(return_value);
+ add_next_index_null(return_value);
}
if (dbh->methods->fetch_err) {
dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value TSRMLS_CC);