Home
last modified time | relevance | path

Searched refs:dbh (Results 1 – 25 of 81) sorted by relevance

1234

/php-src/ext/pdo/
H A Dpdo_dbh.c619 stmt->dbh = dbh; in PHP_METHOD()
671 if (dbh->methods->begin(dbh)) { in PHP_METHOD()
695 if (dbh->methods->commit(dbh)) { in PHP_METHOD()
719 if (dbh->methods->rollback(dbh)) { in PHP_METHOD()
1127 dbh->methods->fetch_err(dbh, dbh->query_stmt, return_value); in PHP_METHOD()
1184 stmt->dbh = dbh; in PHP_METHOD()
1309 if (!dbh || !dbh->methods || !dbh->methods->get_driver_methods) { in pdo_hash_methods()
1449 dbh->methods->closer(dbh); in dbh_free()
1477 pefree(dbh, dbh->is_persistent); in dbh_free()
1489 if (dbh->driver_data && dbh->methods && dbh->methods->rollback && pdo_is_in_transaction(dbh)) { in pdo_dbh_free_storage()
[all …]
H A Dphp_pdo_error.h22 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 Dddl.phpt15 $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 Dddl2.phpt14 $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 Dtransaction_access_mode.phpt14 $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 DrowCount.phpt15 $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 Dgh10908.phpt32 $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 Dbug_64037.phpt15 $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 Dgh13119.phpt15 $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 Dtransaction_isolation_level_behavior.phpt15 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 Derror_handle.phpt14 $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 Dbug_48877.phpt17 $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 Dbug_74462.phpt14 $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 Dautocommit_change_mode.phpt13 $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 Dexecute.phpt14 $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 Dbug_47415.phpt14 $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);
/php-src/ext/pdo_mysql/
H A Dmysql_driver.c81 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()
725 dbh->driver_data = H;
937 dbh->username = pestrdup(vars[5].optval, dbh->is_persistent);
941 dbh->password = pestrdup(vars[6].optval, dbh->is_persistent);
[all …]
/php-src/ext/pdo_odbc/
H A Dodbc_driver.c102 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()
476 dbh->driver_data = H; in pdo_odbc_handle_factory()
530 …bool use_uid_arg = dbh->username != NULL && !php_memnistr(dbh->data_source, "uid=", strlen("uid=")… in pdo_odbc_handle_factory()
531 …bool use_pwd_arg = dbh->password != NULL && !php_memnistr(dbh->data_source, "pwd=", strlen("pwd=")… in pdo_odbc_handle_factory()
553 uid = dbh->username; in pdo_odbc_handle_factory()
570 pwd = dbh->password; in pdo_odbc_handle_factory()
[all …]
/php-src/ext/pdo_pgsql/
H A Dpgsql_driver.c191 ZVAL_COPY_VALUE(&self->dbh, dbh); in pdo_pgsql_create_lob_stream()
199 Z_ADDREF_P(dbh); in pdo_pgsql_create_lob_stream()
574 dbh->in_txn = pgsql_handle_in_transaction(dbh); in pgsql_handle_commit()
593 pdo_dbh_t *dbh; in pgsqlCopyFromArray_internal() local
711 pdo_dbh_t *dbh; in pgsqlCopyFromFile_internal() local
813 pdo_dbh_t *dbh; in pgsqlCopyToFile_internal() local
913 pdo_dbh_t *dbh; in pgsqlCopyToArray_internal() local
993 pdo_dbh_t *dbh; in pgsqlLOBCreate_internal() local
1026 pdo_dbh_t *dbh; in pgsqlLOBOpen_internal() local
1082 pdo_dbh_t *dbh; in pgsqlLOBUnlink_internal() local
[all …]
/php-src/ext/pdo_firebird/
H A Dfirebird_driver.c519 if (!dbh->methods) { in php_firebird_set_error()
531 if (dbh->auto_commit) { in firebird_handle_closer()
540 php_firebird_error(dbh); in firebird_handle_closer()
631 php_firebird_error(dbh); in firebird_handle_preparer()
669 php_firebird_error(dbh); in firebird_handle_doer()
876 if (dbh->auto_commit) { in firebird_handle_manually_commit()
912 if (dbh->auto_commit) { in firebird_handle_manually_rollback()
1297 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, 6); in pdo_firebird_handle_factory()
1300 dbh->username = pestrdup(vars[4].optval, dbh->is_persistent); in pdo_firebird_handle_factory()
1304 dbh->password = pestrdup(vars[5].optval, dbh->is_persistent); in pdo_firebird_handle_factory()
[all …]
/php-src/ext/pdo_dblib/
H A Ddblib_driver.c89 pefree(H, dbh->is_persistent); in dblib_handle_closer()
90 dbh->driver_data = NULL; in dblib_handle_closer()
485 php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); in pdo_dblib_handle_factory()
542 dbh->username = pestrdup(vars[6].optval, dbh->is_persistent); in pdo_dblib_handle_factory()
545 if (dbh->username) { in pdo_dblib_handle_factory()
552 dbh->password = pestrdup(vars[7].optval, dbh->is_persistent); in pdo_dblib_handle_factory()
555 if (dbh->password) { in pdo_dblib_handle_factory()
604 dbh->max_escaped_char_length = 2; in pdo_dblib_handle_factory()
605 dbh->alloc_own_columns = 1; in pdo_dblib_handle_factory()
614 dbh->methods = &dblib_methods; in pdo_dblib_handle_factory()
[all …]
/php-src/ext/pdo_sqlite/
H A Dsqlite_driver.c77 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()
494 pdo_dbh_t *dbh; in pdo_sqlite_create_function_internal() local
552 pdo_dbh_t *dbh; in pdo_sqlite_create_aggregate_internal() local
627 pdo_dbh_t *dbh; in pdo_sqlite_create_collation_internal() local
798 dbh->driver_data = H; in pdo_sqlite_handle_factory()
[all …]
/php-src/ext/pgsql/tests/
H A Dbug47199.phpt14 $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 D80_bug42783.phpt15 $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}");
H A D80_bug32223b.phpt28 $dbh = pg_connect($conn_str);
29 if (!$dbh) {
33 _set_lc_messages($dbh);
35 $res = pg_query($dbh, "CREATE OR REPLACE FUNCTION test_notice() RETURNS boolean AS '
42 $res = pg_query($dbh, 'SET client_min_messages TO NOTICE;');
45 function tester($dbh) {
46 $res = pg_query($dbh, 'SELECT test_notice()');
52 var_dump(pg_last_notice($dbh));
55 tester($dbh);
57 pg_close($dbh);

Completed in 69 milliseconds

1234