/php-src/ext/pdo/ |
H A D | pdo_dbh.c | 651 stmt->dbh = dbh; in PHP_METHOD() 703 if (dbh->methods->begin(dbh)) { in PHP_METHOD() 727 if (dbh->methods->commit(dbh)) { in PHP_METHOD() 751 if (dbh->methods->rollback(dbh)) { in PHP_METHOD() 1159 dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value); in PHP_METHOD() 1216 stmt->dbh = dbh; in PHP_METHOD() 1341 if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) { in pdo_hash_methods() 1481 dbh->methods->closer(dbh); in dbh_free() 1509 pefree(dbh, dbh->is_persistent); in dbh_free() 1521 if (dbh->driver_data && dbh->methods && dbh->methods->rollback && pdo_is_in_transaction(dbh)) { in pdo_dbh_free_storage() [all …]
|
H A D | php_pdo_error.h | 22 PDO_API void pdo_handle_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt); 25 strlcpy(dbh->error_code, PDO_ERR_NONE, sizeof(PDO_ERR_NONE)); \ 26 if (dbh->query_stmt) { \ 27 dbh->query_stmt = NULL; \ 28 zval_ptr_dtor(&dbh->query_stmt_zval); \ 32 #define PDO_HANDLE_DBH_ERR() if (strcmp(dbh->error_code, PDO_ERR_NONE)) { pdo_handle_error(dbh, … 33 …DLE_STMT_ERR() if (strcmp(stmt->error_code, PDO_ERR_NONE)) { pdo_handle_error(stmt->dbh, stmt); }
|
/php-src/ext/pdo_firebird/tests/ |
H A D | ddl.phpt | 15 $dbh = getDbConnection(); 17 @$dbh->exec('DROP TABLE test_ddl'); 19 @$dbh->exec('DROP TRIGGER test_ddl_bi'); 26 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT,0); 28 $dbh->beginTransaction(); 31 $dbh->rollback(); 33 $dbh->beginTransaction(); 35 $dbh->commit(); 37 @$dbh->exec('DROP TABLE test_ddl'); 39 @$dbh->exec('DROP TRIGGER test_ddl_bi'); [all …]
|
H A D | ddl2.phpt | 14 $dbh = getDbConnection(); 15 $dbh->exec("CREATE TABLE test_ddl2 (val int)"); 17 $dbh->beginTransaction(); 18 $dbh->exec("INSERT INTO test_ddl2 (val) VALUES (120)"); 19 $dbh->exec("CREATE TABLE test_ddl2_2 (val INT)"); 20 $dbh->rollback(); 22 $result = $dbh->query("SELECT * FROM test_ddl2"); 25 unset($dbh); 31 $dbh = getDbConnection(); 33 @$dbh->exec('DROP TABLE test_ddl2'); [all …]
|
H A D | transaction_access_mode.phpt | 14 $dbh = getDbConnection(); 15 unset($dbh); 27 $dbh = new PDO( 42 unset($dbh); 48 $dbh = new PDO( 88 $dbh->beginTransaction(); 108 $dbh->commit(); 110 $dbh->beginTransaction(); 129 unset($dbh); 134 $dbh = getDbConnection(); [all …]
|
H A D | rowCount.phpt | 15 $dbh = getDbConnection(); 16 $dbh->exec('CREATE TABLE test_rowcount (A VARCHAR(10))'); 17 $dbh->exec("INSERT INTO test_rowcount VALUES ('A')"); 18 $dbh->exec("INSERT INTO test_rowcount VALUES ('A')"); 19 $dbh->exec("INSERT INTO test_rowcount VALUES ('B')"); 23 $stmt = $dbh->prepare($query); 34 $stmt = $dbh->prepare('DELETE FROM test_rowcount'); 39 unset($dbh); 45 $dbh = getDbConnection(); 46 @$dbh->exec('DROP TABLE test_rowcount'); [all …]
|
H A D | bug_64037.phpt | 15 $dbh = getDbConnection(); 16 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 18 $dbh->exec("INSERT INTO test64037 (ID, TEXT, COST) VALUES (1, 'test', -1.0)"); 19 $dbh->exec("INSERT INTO test64037 (ID, TEXT, COST) VALUES (2, 'test', -0.99)"); 20 $dbh->exec("INSERT INTO test64037 (ID, TEXT, COST) VALUES (3, 'test', -1.01)"); 23 $stmt = $dbh->prepare($query); 31 $stmt = $dbh->prepare('DELETE FROM test64037'); 35 unset($dbh); 41 $dbh = getDbConnection(); 42 @$dbh->exec("DROP TABLE test64037"); [all …]
|
H A D | gh13119.phpt | 15 $dbh = getDbConnection(); 16 $dbh->exec('CREATE TABLE gh13119 (f_val FLOAT, d_val DOUBLE PRECISION)'); 18 $dbh->exec('INSERT INTO gh13119 VALUES (0.1, 0.1)'); 19 $dbh->exec('INSERT INTO gh13119 VALUES (0.0000000000000001, 0.0000000000000001)'); 20 $dbh->exec('INSERT INTO gh13119 VALUES (12.000000, 12.00000000000000)'); 21 $dbh->exec('INSERT INTO gh13119 VALUES (12.000001, 12.00000000000001)'); 22 $dbh->exec('INSERT INTO gh13119 VALUES (12.345678, 12.34567890123456)'); 25 $stmt = $dbh->query('select * from gh13119'); 31 $dbh = getDbConnection(); 32 @$dbh->exec('DROP TABLE gh13119'); [all …]
|
H A D | gh10908.phpt | 32 $dbh = getDbConnection(); 33 $dbh->exec($sql); 36 function query_and_dump($dbh, $sql) { 37 foreach ($dbh->query($sql) as $row) { 43 query_and_dump($dbh, "SELECT CODE FROM gh10908"); // works fine 44 query_and_dump($dbh, "SELECT ID FROM gh10908"); // Used to "bus error" 45 query_and_dump($dbh, "SELECT NUM FROM gh10908"); // Used to "bus error" 46 query_and_dump($dbh, "SELECT DBL FROM gh10908"); // Used to "bus error" 61 $dbh = getDbConnection(); 62 @$dbh->exec("DROP TABLE gh10908"); [all …]
|
H A D | transaction_isolation_level_behavior.phpt | 15 unset($dbh); 28 $dbh = new PDO( 43 $dbh->commit(); 45 unset($dbh); 50 $dbh = new PDO( 66 $dbh->commit(); 68 unset($dbh); 73 $dbh = new PDO( 91 unset($dbh); 124 unset($dbh); [all …]
|
H A D | error_handle.phpt | 14 $dbh = getDbConnection(); 15 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 18 $dbh->query("CREATE TABLE {$table} (val int)"); 20 echo "dbh error"; 21 $dbh->query("INSERT INTO {$table} VALUES ('str')"); 26 $stmt = $dbh->prepare("INSERT INTO {$table} VALUES ('str')"); 29 unset($dbh); 34 $dbh = getDbConnection(); 35 @$dbh->exec('DROP TABLE error_handle'); 36 unset($dbh); [all …]
|
H A D | bug_48877.phpt | 17 $dbh = getDbConnection(); 18 $dbh->exec('CREATE TABLE test48877 (A integer)'); 19 $dbh->exec("INSERT INTO test48877 VALUES ('1')"); 20 $dbh->exec("INSERT INTO test48877 VALUES ('2')"); 21 $dbh->exec("INSERT INTO test48877 VALUES ('3')"); 25 $stmt = $dbh->prepare($query); 33 $stmt = $dbh->prepare('DELETE FROM test48877'); 37 unset($dbh); 43 $dbh = getDbConnection(); 44 @$dbh->exec("DROP TABLE test48877"); [all …]
|
H A D | bug_74462.phpt | 14 $dbh = getDbConnection(); 15 $dbh->exec('recreate table test74462 (id integer not null, abool boolean)'); 16 $dbh->exec('insert into test74462 (id, abool) values (1, true)'); 17 $dbh->exec('insert into test74462 (id, abool) values (2, false)'); 18 $dbh->exec('insert into test74462 (id, abool) values (3, null)'); 19 $S = $dbh->query('select abool from test74462 order by id'); 22 unset($dbh); 28 $dbh = getDbConnection(); 29 @$dbh->exec("DROP TABLE test74462"); 30 unset($dbh);
|
H A D | autocommit_change_mode.phpt | 13 $dbh = getDbConnection(); 14 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, true); 19 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, true); 20 var_dump($dbh->getAttribute(PDO::ATTR_AUTOCOMMIT)); 24 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, false); 29 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, false); 34 $dbh->setAttribute(PDO::ATTR_AUTOCOMMIT, true); 41 $dbh->beginTransaction(); 61 $dbh->rollback(); 67 $dbh->beginTransaction(); [all …]
|
H A D | execute.phpt | 14 $dbh = getDbConnection(); 15 var_dump($dbh->getAttribute(PDO::ATTR_CONNECTION_STATUS)); 17 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 18 $dbh->setAttribute(PDO::FB_ATTR_TIMESTAMP_FORMAT, '%Y-%m-%d %H:%M:%S'); 22 $dbh->exec("INSERT INTO test_execute (id,text) VALUES (1,'bla')"); 24 $s = $dbh->prepare("SELECT * FROM test_execute WHERE id=? FOR UPDATE"); 40 var_dump($dbh->exec("UPDATE test_execute SET id=2 WHERE CURRENT OF c")); 45 unset($dbh); 51 $dbh = getDbConnection(); 52 @$dbh->exec('DROP TABLE test_execute'); [all …]
|
H A D | bug_47415.phpt | 14 $dbh = getDbConnection(); 15 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 17 $dbh->exec('CREATE TABLE test47415 (idx int NOT NULL PRIMARY KEY, txt VARCHAR(20))'); 18 $dbh->exec('INSERT INTO test47415 VALUES(0, \'String0\')'); 22 $stmt = $dbh->prepare($query); 31 $stmt = $dbh->prepare('DELETE FROM test47415'); 35 unset($dbh); 40 $dbh = getDbConnection(); 41 @$dbh->exec("DROP TABLE test47415"); 42 unset($dbh);
|
H A D | bug_aaa.phpt | 14 $dbh = getDbConnection(); 15 $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); 16 $dbh->exec('create table test_aaa (id integer)'); 17 $S = $dbh->prepare('insert into test_aaa (id) values (:id) returning id'); 21 unset($dbh); 27 $dbh = getDbConnection(); 28 @$dbh->exec("DROP TABLE test_aaa"); 29 unset($dbh);
|
/php-src/ext/pdo_mysql/ |
H A D | mysql_driver.c | 81 dbh->is_persistent); in _pdo_mysql_error() 88 dbh->is_persistent); in _pdo_mysql_error() 94 dbh->is_persistent); in _pdo_mysql_error() 114 if (!dbh->methods) { in _pdo_mysql_error() 207 pdo_mysql_error(dbh); in mysql_handle_preparer() 225 pdo_mysql_error(dbh); in mysql_handle_preparer() 266 pdo_mysql_error(dbh); in mysql_handle_doer() 737 dbh->driver_data = H; 949 dbh->username = pestrdup(vars[5].optval, dbh->is_persistent); 953 dbh->password = pestrdup(vars[6].optval, dbh->is_persistent); [all …]
|
/php-src/ext/pdo_odbc/ |
H A D | odbc_driver.c | 102 if (!dbh->methods) { in pdo_odbc_error() 136 dbh->driver_data = NULL; in odbc_handle_closer() 269 if (dbh->auto_commit) { in odbc_handle_begin() 298 if (dbh->auto_commit) { in odbc_handle_commit() 351 if (dbh->in_txn) { in odbc_handle_set_attr() 477 dbh->driver_data = H; in pdo_odbc_handle_factory() 531 …bool use_uid_arg = dbh->username != NULL && !php_memnistr(dbh->data_source, "uid=", strlen("uid=")… in pdo_odbc_handle_factory() 532 …bool use_pwd_arg = dbh->password != NULL && !php_memnistr(dbh->data_source, "pwd=", strlen("pwd=")… in pdo_odbc_handle_factory() 554 uid = dbh->username; in pdo_odbc_handle_factory() 571 pwd = dbh->password; in pdo_odbc_handle_factory() [all …]
|
/php-src/ext/pdo_pgsql/ |
H A D | pgsql_driver.c | 209 ZVAL_COPY_VALUE(&self->dbh, dbh); in pdo_pgsql_create_lob_stream() 217 Z_ADDREF_P(dbh); in pdo_pgsql_create_lob_stream() 603 dbh->in_txn = pgsql_handle_in_transaction(dbh); in pgsql_handle_commit() 648 pdo_dbh_t *dbh; in pgsqlCopyFromArray_internal() local 770 pdo_dbh_t *dbh; in pgsqlCopyFromFile_internal() local 872 pdo_dbh_t *dbh; in pgsqlCopyToFile_internal() local 972 pdo_dbh_t *dbh; in pgsqlCopyToArray_internal() local 1052 pdo_dbh_t *dbh; in pgsqlLOBCreate_internal() local 1085 pdo_dbh_t *dbh; in pgsqlLOBOpen_internal() local 1141 pdo_dbh_t *dbh; in pgsqlLOBUnlink_internal() local [all …]
|
/php-src/ext/pdo_firebird/ |
H A D | firebird_driver.c | 577 if (!dbh->methods) { in php_firebird_set_error() 589 if (dbh->auto_commit) { in firebird_handle_closer() 598 php_firebird_error(dbh); in firebird_handle_closer() 702 php_firebird_error(dbh); in firebird_handle_preparer() 740 php_firebird_error(dbh); in firebird_handle_doer() 947 if (dbh->auto_commit) { in firebird_handle_manually_commit() 983 if (dbh->auto_commit) { in firebird_handle_manually_rollback() 1338 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 6); in pdo_firebird_handle_factory() 1341 dbh->username = pestrdup(vars[4].optval, dbh->is_persistent); in pdo_firebird_handle_factory() 1345 dbh->password = pestrdup(vars[5].optval, dbh->is_persistent); in pdo_firebird_handle_factory() [all …]
|
/php-src/ext/pdo_dblib/ |
H A D | dblib_driver.c | 89 pefree(H, dbh->is_persistent); in dblib_handle_closer() 90 dbh->driver_data = NULL; in dblib_handle_closer() 486 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); in pdo_dblib_handle_factory() 543 dbh->username = pestrdup(vars[6].optval, dbh->is_persistent); in pdo_dblib_handle_factory() 546 if (dbh->username) { in pdo_dblib_handle_factory() 553 dbh->password = pestrdup(vars[7].optval, dbh->is_persistent); in pdo_dblib_handle_factory() 556 if (dbh->password) { in pdo_dblib_handle_factory() 605 dbh->max_escaped_char_length = 2; in pdo_dblib_handle_factory() 606 dbh->alloc_own_columns = 1; in pdo_dblib_handle_factory() 615 dbh->methods = &dblib_methods; in pdo_dblib_handle_factory() [all …]
|
/php-src/ext/pdo_sqlite/ |
H A D | sqlite_driver.c | 77 if (!dbh->methods) { in _pdo_sqlite_error() 189 pdo_sqlite_error(dbh); in sqlite_handle_preparer() 198 pdo_sqlite_error(dbh); in sqlite_handle_preparer() 208 pdo_sqlite_error(dbh); in sqlite_handle_doer() 242 pdo_sqlite_error(dbh); in sqlite_handle_begin() 253 pdo_sqlite_error(dbh); in sqlite_handle_commit() 503 pdo_dbh_t *dbh; in pdo_sqlite_create_function_internal() local 561 pdo_dbh_t *dbh; in pdo_sqlite_create_aggregate_internal() local 636 pdo_dbh_t *dbh; in pdo_sqlite_create_collation_internal() local 808 dbh->driver_data = H; in pdo_sqlite_handle_factory() [all …]
|
/php-src/ext/pgsql/tests/ |
H A D | bug47199.phpt | 14 $dbh = pg_connect($conn_str); 16 pg_query($dbh, "CREATE TABLE $tbl_name (null_field INT, not_null_field INT NOT NULL)"); 18 pg_insert($dbh, $tbl_name, array('null_field' => null, 'not_null_field' => 1)); 19 pg_insert($dbh, $tbl_name, array('null_field' => null, 'not_null_field' => 2)); 21 var_dump(pg_fetch_all(pg_query($dbh, 'SELECT * FROM '. $tbl_name))); 23 $query = pg_delete($dbh, $tbl_name, array('null_field' => NULL,'not_null_field' => 2), PGSQL_DML_ST… 27 $query = pg_update($dbh, $tbl_name, array('null_field' => NULL, 'not_null_field' => 0), array('not_… 31 var_dump(pg_fetch_all(pg_query($dbh, 'SELECT * FROM '. $tbl_name))); 33 pg_close($dbh); 41 $dbh = pg_connect($conn_str); [all …]
|
H A D | 80_bug42783.phpt | 15 $dbh = @pg_connect($conn_str); 16 if (!$dbh) { 20 pg_query($dbh, "CREATE TABLE {$table_name} (id SERIAL PRIMARY KEY, time TIMESTAMP NOT NULL DEFAULT … 22 pg_insert($dbh, $table_name, array()); 24 var_dump(pg_fetch_assoc(pg_query($dbh, "SELECT * FROM {$table_name}"))); 26 pg_close($dbh); 33 $dbh = pg_connect($conn_str); 34 pg_query($dbh, "DROP TABLE IF EXISTS {$table_name}");
|