Lines Matching refs:stmt

79 int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int num_vars, zval *args, const char * c…  in mysqli_stmt_bind_param_do_bind()  argument
89 params = mysqlnd_stmt_alloc_param_bind(stmt->stmt); in mysqli_stmt_bind_param_do_bind()
115 mysqlnd_stmt_free_param_bind(stmt->stmt, params); in mysqli_stmt_bind_param_do_bind()
121 ret = mysqlnd_stmt_bind_param(stmt->stmt, params); in mysqli_stmt_bind_param_do_bind()
133 MY_STMT *stmt; in PHP_FUNCTION() local
142 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
155 if (types_len != mysql_stmt_param_count(stmt->stmt)) { in PHP_FUNCTION()
160 RETVAL_BOOL(!mysqli_stmt_bind_param_do_bind(stmt, argc, args, types, getThis() ? 1 : 2)); in PHP_FUNCTION()
161 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
167 mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval *args, unsigned int argc) in mysqli_stmt_bind_result_do_bind() argument
170 MYSQLND_RESULT_BIND *params = mysqlnd_stmt_alloc_result_bind(stmt->stmt); in mysqli_stmt_bind_result_do_bind()
175 return mysqlnd_stmt_bind_result(stmt->stmt, params); in mysqli_stmt_bind_result_do_bind()
187 MY_STMT *stmt; in PHP_FUNCTION() local
194 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
196 if ((uint32_t)argc != mysql_stmt_field_count(stmt->stmt)) { in PHP_FUNCTION()
201 rc = mysqli_stmt_bind_result_do_bind(stmt, args, argc); in PHP_FUNCTION()
421 MY_STMT *stmt; in PHP_FUNCTION() local
428 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
444 param_count = mysql_stmt_param_count(stmt->stmt); in PHP_FUNCTION()
450 params = mysqlnd_stmt_alloc_param_bind(stmt->stmt); in PHP_FUNCTION()
460 if (mysqlnd_stmt_bind_param(stmt->stmt, params)) { in PHP_FUNCTION()
461 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
466 if (mysql_stmt_execute(stmt->stmt)) { in PHP_FUNCTION()
467 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
474 php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt)); in PHP_FUNCTION()
479 void close_stmt_and_copy_errors(MY_STMT *stmt, MY_MYSQL *mysql) in close_stmt_and_copy_errors() argument
482 MYSQLND_ERROR_INFO error_info = *stmt->stmt->data->error_info; in close_stmt_and_copy_errors()
483 stmt->stmt->data->error_info->error_list.head = NULL; in close_stmt_and_copy_errors()
484 stmt->stmt->data->error_info->error_list.tail = NULL; in close_stmt_and_copy_errors()
485 stmt->stmt->data->error_info->error_list.count = 0; in close_stmt_and_copy_errors()
490 mysqli_stmt_close(stmt->stmt, false); in close_stmt_and_copy_errors()
491 stmt->stmt = NULL; in close_stmt_and_copy_errors()
492 php_clear_stmt_bind(stmt); in close_stmt_and_copy_errors()
503 MY_STMT *stmt; in PHP_FUNCTION() local
516 stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); in PHP_FUNCTION()
518 if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) { in PHP_FUNCTION()
520 efree(stmt); in PHP_FUNCTION()
524 if (FAIL == mysql_stmt_prepare(stmt->stmt, query, query_len)) { in PHP_FUNCTION()
525 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
527 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
535 stmt->query = estrdup(query); in PHP_FUNCTION()
548 mysqli_stmt_close(stmt->stmt, false); in PHP_FUNCTION()
549 stmt->stmt = NULL; in PHP_FUNCTION()
550 efree(stmt); in PHP_FUNCTION()
556 param_count = mysql_stmt_param_count(stmt->stmt); in PHP_FUNCTION()
558 mysqli_stmt_close(stmt->stmt, false); in PHP_FUNCTION()
559 stmt->stmt = NULL; in PHP_FUNCTION()
560 efree(stmt); in PHP_FUNCTION()
565 params = mysqlnd_stmt_alloc_param_bind(stmt->stmt); in PHP_FUNCTION()
575 if (mysqlnd_stmt_bind_param(stmt->stmt, params)) { in PHP_FUNCTION()
576 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
582 if (mysql_stmt_execute(stmt->stmt)) { in PHP_FUNCTION()
583 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
586 php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt)); in PHP_FUNCTION()
589 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
593 if (!mysql_stmt_field_count(stmt->stmt)) { in PHP_FUNCTION()
595 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
600 php_mysqli_report_index(stmt->query, mysqli_stmt_server_status(stmt->stmt)); in PHP_FUNCTION()
604 if (!(result = mysqlnd_stmt_get_result(stmt->stmt))) { in PHP_FUNCTION()
605 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
607 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
616 close_stmt_and_copy_errors(stmt, mysql); in PHP_FUNCTION()
622 MY_STMT *stmt; in mysqli_stmt_fetch_mysqlnd() local
629 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in mysqli_stmt_fetch_mysqlnd()
631 if (FAIL == mysqlnd_stmt_fetch(stmt->stmt, &fetched_anything)) { in mysqli_stmt_fetch_mysqlnd()
632 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in mysqli_stmt_fetch_mysqlnd()
1103 MY_STMT *stmt; in PHP_FUNCTION() local
1109 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1111 RETURN_BOOL(mysqlnd_stmt_more_results(stmt->stmt)); in PHP_FUNCTION()
1117 MY_STMT *stmt; in PHP_FUNCTION() local
1123 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1125 if (mysql_stmt_next_result(stmt->stmt)) { in PHP_FUNCTION()
1126 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
1299 MY_STMT *stmt; in PHP_FUNCTION() local
1310 stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); in PHP_FUNCTION()
1312 if ((stmt->stmt = mysql_stmt_init(mysql->mysql))) { in PHP_FUNCTION()
1313 if (mysql_stmt_prepare(stmt->stmt, query, query_len)) { in PHP_FUNCTION()
1319 mysqli_stmt_close(stmt->stmt, false); in PHP_FUNCTION()
1320 stmt->stmt = NULL; in PHP_FUNCTION()
1330 if (stmt->stmt && query_len && (MyG(report_mode) & MYSQLI_REPORT_INDEX)) { in PHP_FUNCTION()
1331 stmt->query = estrdup(query); in PHP_FUNCTION()
1335 if (!stmt->stmt) { in PHP_FUNCTION()
1337 efree(stmt); in PHP_FUNCTION()
1342 mysqli_resource->ptr = (void *)stmt; in PHP_FUNCTION()
1435 MY_STMT *stmt; in PHP_FUNCTION() local
1445 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1452 if (mysql_stmt_send_long_data(stmt->stmt, param_nr, data, data_len)) { in PHP_FUNCTION()
1462 MY_STMT *stmt; in PHP_FUNCTION() local
1469 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1471 rc = mysql_stmt_affected_rows(stmt->stmt); in PHP_FUNCTION()
1482 MY_STMT *stmt; in PHP_FUNCTION() local
1488 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1490 mysqli_stmt_close(stmt->stmt, false); in PHP_FUNCTION()
1491 stmt->stmt = NULL; in PHP_FUNCTION()
1492 php_clear_stmt_bind(stmt); in PHP_FUNCTION()
1501 MY_STMT *stmt; in PHP_FUNCTION() local
1514 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1516 mysql_stmt_data_seek(stmt->stmt, offset); in PHP_FUNCTION()
1523 MY_STMT *stmt; in PHP_FUNCTION() local
1529 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1531 RETURN_LONG(mysql_stmt_field_count(stmt->stmt)); in PHP_FUNCTION()
1538 MY_STMT *stmt; in PHP_FUNCTION() local
1545 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1547 mysql_stmt_free_result(stmt->stmt); in PHP_FUNCTION()
1554 MY_STMT *stmt; in PHP_FUNCTION() local
1561 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1562 rc = mysql_stmt_insert_id(stmt->stmt); in PHP_FUNCTION()
1570 MY_STMT *stmt; in PHP_FUNCTION() local
1576 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1578 RETURN_LONG(mysql_stmt_param_count(stmt->stmt)); in PHP_FUNCTION()
1585 MY_STMT *stmt; in PHP_FUNCTION() local
1592 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1594 if (mysql_stmt_reset(stmt->stmt)) { in PHP_FUNCTION()
1604 MY_STMT *stmt; in PHP_FUNCTION() local
1612 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1614 rc = mysql_stmt_num_rows(stmt->stmt); in PHP_FUNCTION()
1719 MY_STMT *stmt; in PHP_FUNCTION() local
1731 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1772 if (FAIL == mysql_stmt_attr_set(stmt->stmt, attr, mode_p)) { in PHP_FUNCTION()
1773 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
1783 MY_STMT *stmt; in PHP_FUNCTION() local
1793 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1795 if ((rc = mysql_stmt_attr_get(stmt->stmt, attr, &value))) { in PHP_FUNCTION()
1814 MY_STMT *stmt; in PHP_FUNCTION() local
1820 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED); in PHP_FUNCTION()
1822 RETURN_LONG(mysql_stmt_errno(stmt->stmt)); in PHP_FUNCTION()
1829 MY_STMT *stmt; in PHP_FUNCTION() local
1835 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED); in PHP_FUNCTION()
1837 RETURN_STRING(mysql_stmt_error(stmt->stmt)); in PHP_FUNCTION()
1845 MY_STMT *stmt; in PHP_FUNCTION() local
1854 stmt = (MY_STMT *)ecalloc(1,sizeof(MY_STMT)); in PHP_FUNCTION()
1856 if (!(stmt->stmt = mysql_stmt_init(mysql->mysql))) { in PHP_FUNCTION()
1857 efree(stmt); in PHP_FUNCTION()
1863 mysqli_resource->ptr = (void *)stmt; in PHP_FUNCTION()
1871 MY_STMT *stmt; in PHP_FUNCTION() local
1879 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_INITIALIZED); in PHP_FUNCTION()
1881 if (mysql_stmt_prepare(stmt->stmt, query, query_len)) { in PHP_FUNCTION()
1882 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
1894 MY_STMT *stmt; in PHP_FUNCTION() local
1902 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1904 if (!(result = mysql_stmt_result_metadata(stmt->stmt))){ in PHP_FUNCTION()
1905 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
1919 MY_STMT *stmt; in PHP_FUNCTION() local
1925 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1927 if (mysql_stmt_store_result(stmt->stmt)){ in PHP_FUNCTION()
1928 MYSQLI_REPORT_STMT_ERROR(stmt->stmt); in PHP_FUNCTION()
1938 MY_STMT *stmt; in PHP_FUNCTION() local
1944 MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID); in PHP_FUNCTION()
1946 RETURN_STRING(mysql_stmt_sqlstate(stmt->stmt)); in PHP_FUNCTION()