Lines Matching refs:stmt_obj
468 php_sqlite3_stmt *stmt_obj; local
487 stmt_obj = Z_SQLITE3_STMT_P(return_value);
488 stmt_obj->db_obj = db_obj;
489 ZVAL_COPY(&stmt_obj->db_obj_zval, object);
491 errcode = sqlite3_prepare_v2(db_obj->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &(stmt_obj->stmt), NULL);
498 stmt_obj->initialised = 1;
501 free_item->stmt_obj = stmt_obj;
514 php_sqlite3_stmt *stmt_obj; local
542 stmt_obj = Z_SQLITE3_STMT_P(&stmt);
543 stmt_obj->db_obj = db_obj;
544 ZVAL_COPY(&stmt_obj->db_obj_zval, object);
546 …return_code = sqlite3_prepare_v2(db_obj->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &(stmt_obj->stmt), NULL…
553 stmt_obj->initialised = 1;
558 result->stmt_obj = stmt_obj;
561 return_code = sqlite3_step(result->stmt_obj->stmt);
569 free_item->stmt_obj = stmt_obj;
572 sqlite3_reset(result->stmt_obj->stmt);
579 sqlite3_finalize(stmt_obj->stmt);
580 stmt_obj->initialised = 0;
1273 php_sqlite3_stmt *stmt_obj; local
1275 stmt_obj = Z_SQLITE3_STMT_P(object);
1281 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1282 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1284 RETURN_LONG(sqlite3_bind_parameter_count(stmt_obj->stmt));
1292 php_sqlite3_stmt *stmt_obj; local
1294 stmt_obj = Z_SQLITE3_STMT_P(object);
1300 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1302 if(stmt_obj->db_obj) {
1303 …zend_llist_del_element(&(stmt_obj->db_obj->free_list), object, (int (*)(void *, void *)) php_sqlit…
1314 php_sqlite3_stmt *stmt_obj; local
1316 stmt_obj = Z_SQLITE3_STMT_P(object);
1322 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1323 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1325 if (sqlite3_reset(stmt_obj->stmt) != SQLITE_OK) {
1326 …php_sqlite3_error(stmt_obj->db_obj, "Unable to reset statement: %s", sqlite3_errmsg(sqlite3_db_han…
1337 php_sqlite3_stmt *stmt_obj; local
1339 stmt_obj = Z_SQLITE3_STMT_P(object);
1345 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1346 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1348 if (sqlite3_clear_bindings(stmt_obj->stmt) != SQLITE_OK) {
1349 …php_sqlite3_error(stmt_obj->db_obj, "Unable to clear statement: %s", sqlite3_errmsg(sqlite3_db_han…
1353 if (stmt_obj->bound_params) {
1354 zend_hash_destroy(stmt_obj->bound_params);
1355 FREE_HASHTABLE(stmt_obj->bound_params);
1356 stmt_obj->bound_params = NULL;
1367 php_sqlite3_stmt *stmt_obj; local
1369 stmt_obj = Z_SQLITE3_STMT_P(object);
1375 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1376 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1379 if (sqlite3_stmt_readonly(stmt_obj->stmt)) {
1458 php_sqlite3_stmt *stmt_obj; local
1462 stmt_obj = Z_SQLITE3_STMT_P(object);
1473 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1474 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1482 if (!register_bound_parameter_to_sqlite(¶m, stmt_obj)) {
1497 php_sqlite3_stmt *stmt_obj; local
1501 stmt_obj = Z_SQLITE3_STMT_P(object);
1512 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1513 SQLITE3_CHECK_INITIALIZED_STMT(stmt_obj->stmt, SQLite3Stmt);
1521 if (!register_bound_parameter_to_sqlite(¶m, stmt_obj)) {
1538 php_sqlite3_stmt *stmt_obj; local
1544 stmt_obj = Z_SQLITE3_STMT_P(object);
1550 SQLITE3_CHECK_INITIALIZED(stmt_obj->db_obj, stmt_obj->initialised, SQLite3);
1552 if (stmt_obj->bound_params) {
1553 ZEND_HASH_FOREACH_PTR(stmt_obj->bound_params, param) {
1564 sqlite3_bind_null(stmt_obj->stmt, param->param_number);
1572 sqlite3_bind_int64(stmt_obj->stmt, param->param_number, Z_LVAL_P(parameter));
1574 sqlite3_bind_int(stmt_obj->stmt, param->param_number, Z_LVAL_P(parameter));
1580 sqlite3_bind_double(stmt_obj->stmt, param->param_number, Z_DVAL_P(parameter));
1590 …php_sqlite3_error(stmt_obj->db_obj, "Unable to read stream for parameter %ld", param->param_number…
1599 …sqlite3_bind_blob(stmt_obj->stmt, param->param_number, ZSTR_VAL(buffer), ZSTR_LEN(buffer), SQLITE_…
1602 sqlite3_bind_null(stmt_obj->stmt, param->param_number);
1609 …sqlite3_bind_text(stmt_obj->stmt, param->param_number, Z_STRVAL_P(parameter), Z_STRLEN_P(parameter…
1613 sqlite3_bind_null(stmt_obj->stmt, param->param_number);
1617 …php_sqlite3_error(stmt_obj->db_obj, "Unknown parameter type: %pd for parameter %pd", param->type, …
1623 return_code = sqlite3_step(stmt_obj->stmt);
1629 sqlite3_reset(stmt_obj->stmt);
1634 result->db_obj = stmt_obj->db_obj;
1635 result->stmt_obj = stmt_obj;
1641 sqlite3_reset(stmt_obj->stmt);
1645 …php_sqlite3_error(stmt_obj->db_obj, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_h…
1659 php_sqlite3_stmt *stmt_obj; local
1668 stmt_obj = Z_SQLITE3_STMT_P(object);
1684 stmt_obj->db_obj = db_obj;
1685 ZVAL_COPY(&stmt_obj->db_obj_zval, db_zval);
1687 errcode = sqlite3_prepare_v2(db_obj->db, ZSTR_VAL(sql), ZSTR_LEN(sql), &(stmt_obj->stmt), NULL);
1693 stmt_obj->initialised = 1;
1696 free_item->stmt_obj = stmt_obj;
1712 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1718 RETURN_LONG(sqlite3_column_count(result_obj->stmt_obj->stmt));
1732 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1737 column_name = (char*) sqlite3_column_name(result_obj->stmt_obj->stmt, column);
1756 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1766 RETURN_LONG(sqlite3_column_type(result_obj->stmt_obj->stmt, column));
1780 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1786 ret = sqlite3_step(result_obj->stmt_obj->stmt);
1796 for (i = 0; i < sqlite3_data_count(result_obj->stmt_obj->stmt); i++) {
1799 sqlite_value_to_zval(result_obj->stmt_obj->stmt, i, &data);
1811 add_assoc_zval(return_value, (char*)sqlite3_column_name(result_obj->stmt_obj->stmt, i), &data);
1822 … "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(result_obj->stmt_obj->stmt)));
1835 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1841 if (sqlite3_reset(result_obj->stmt_obj->stmt) != SQLITE_OK) {
1859 SQLITE3_CHECK_INITIALIZED(result_obj->db_obj, result_obj->stmt_obj->initialised, SQLite3Result)
1870 sqlite3_reset(result_obj->stmt_obj->stmt);
2068 if (free_item->stmt_obj && free_item->stmt_obj->initialised) {
2069 sqlite3_finalize(free_item->stmt_obj->stmt);
2070 free_item->stmt_obj->initialised = 0;
2078 …return ((*free_list)->stmt_obj->initialised && Z_PTR_P(statement) == Z_PTR((*free_list)->stmt_obj…
2084 return ((*free_list)->stmt_obj->initialised && statement == (*free_list)->stmt_obj->stmt);
2177 if (intern->stmt_obj && intern->stmt_obj->initialised) {
2178 sqlite3_reset(intern->stmt_obj->stmt);