Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
src /
php-7.4.33 /
ext /
pdo_mysql /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
CONFLICTS
6
B
-rw-rw-r--
2022-10-31 11:36
PDO_getAvaliableDrivers.phpt
344
B
-rw-rw-r--
2022-10-31 11:36
README.md
725
B
-rw-rw-r--
2022-10-31 11:36
bug41125.phpt
4.46
KB
-rw-rw-r--
2022-10-31 11:36
bug44327.phpt
1.53
KB
-rw-rw-r--
2022-10-31 11:36
bug46292.phpt
1.82
KB
-rw-rw-r--
2022-10-31 11:36
bug53551.phpt
1.61
KB
-rw-rw-r--
2022-10-31 11:36
bug53782.phpt
874
B
-rw-rw-r--
2022-10-31 11:36
bug54929.phpt
1.65
KB
-rw-rw-r--
2022-10-31 11:36
bug63176.phpt
1.12
KB
-rw-rw-r--
2022-10-31 11:36
bug63185.phpt
1.62
KB
-rw-rw-r--
2022-10-31 11:36
bug66141.phpt
1.24
KB
-rw-rw-r--
2022-10-31 11:36
bug66528.phpt
2.09
KB
-rw-rw-r--
2022-10-31 11:36
bug68371.phpt
2.21
KB
-rw-rw-r--
2022-10-31 11:36
bug70066.phpt
798
B
-rw-rw-r--
2022-10-31 11:36
bug70272.phpt
644
B
-rw-rw-r--
2022-10-31 11:36
bug70389.phpt
670
B
-rw-rw-r--
2022-10-31 11:36
bug70862.phpt
1.16
KB
-rw-rw-r--
2022-10-31 11:36
bug71145.phpt
688
B
-rw-rw-r--
2022-10-31 11:36
bug71569.phpt
546
B
-rw-rw-r--
2022-10-31 11:36
bug75177.phpt
832
B
-rw-rw-r--
2022-10-31 11:36
bug76815.phpt
969
B
-rw-rw-r--
2022-10-31 11:36
bug77289.phpt
657
B
-rw-rw-r--
2022-10-31 11:36
bug78152.phpt
1.12
KB
-rw-rw-r--
2022-10-31 11:36
bug79375.phpt
3.3
KB
-rw-rw-r--
2022-10-31 11:36
bug79596.phpt
894
B
-rw-rw-r--
2022-10-31 11:36
bug80458.phpt
4.23
KB
-rw-rw-r--
2022-10-31 11:36
bug81037.phpt
1.02
KB
-rw-rw-r--
2022-10-31 11:36
bug_33689.phpt
1.47
KB
-rw-rw-r--
2022-10-31 11:36
bug_37445.phpt
694
B
-rw-rw-r--
2022-10-31 11:36
bug_38546.phpt
6.12
KB
-rw-rw-r--
2022-10-31 11:36
bug_39483.phpt
714
B
-rw-rw-r--
2022-10-31 11:36
bug_39858.phpt
2.29
KB
-rw-rw-r--
2022-10-31 11:36
bug_41125.phpt
1.69
KB
-rw-rw-r--
2022-10-31 11:36
bug_41698.phpt
988
B
-rw-rw-r--
2022-10-31 11:36
bug_41997.phpt
1.56
KB
-rw-rw-r--
2022-10-31 11:36
bug_42499.phpt
2.79
KB
-rw-rw-r--
2022-10-31 11:36
bug_43371.phpt
476
B
-rw-rw-r--
2022-10-31 11:36
bug_44454.phpt
2.88
KB
-rw-rw-r--
2022-10-31 11:36
bug_44707.phpt
2.46
KB
-rw-rw-r--
2022-10-31 11:36
bug_45120.phpt
1.3
KB
-rw-rw-r--
2022-10-31 11:36
bug_50323.phpt
1.64
KB
-rw-rw-r--
2022-10-31 11:36
bug_51670.phpt
689
B
-rw-rw-r--
2022-10-31 11:36
bug_61207.phpt
2.38
KB
-rw-rw-r--
2022-10-31 11:36
bug_61411.phpt
1.32
KB
-rw-rw-r--
2022-10-31 11:36
bug_61755.phpt
1
KB
-rw-rw-r--
2022-10-31 11:36
bug_64705.phpt
427
B
-rw-rw-r--
2022-10-31 11:36
bug_74376.phpt
859
B
-rw-rw-r--
2022-10-31 11:36
bug_pecl_12925.phpt
1.38
KB
-rw-rw-r--
2022-10-31 11:36
bug_pecl_7976.phpt
2.05
KB
-rw-rw-r--
2022-10-31 11:36
common.phpt
794
B
-rw-rw-r--
2022-10-31 11:36
config.inc
2.23
KB
-rw-rw-r--
2022-10-31 11:36
last_insert_id.phpt
934
B
-rw-rw-r--
2022-10-31 11:36
mysql_pdo_test.inc
4.44
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql___construct.phpt
11.09
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql___construct_ini.phpt
1.38
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql___construct_options.phpt
7.71
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql___construct_options_libmysql.phpt
3.09
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql___construct_uri.phpt
2.13
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_autocommit.phpt
3.47
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_case.phpt
5.1
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_client_version.phpt
1.13
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_connection_status.phpt
939
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_driver_name.phpt
830
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_errmode.phpt
5.41
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_fetch_table_names.phpt
900
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_init_command.phpt
1.17
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_max_buffer_size.phpt
2.14
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_multi_statements.phpt
2.21
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_oracle_nulls.phpt
3.22
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_prefetch.phpt
651
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_server_info.phpt
1.63
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_server_version.phpt
2.46
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_attr_statement_class.phpt
5.26
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_begintransaction.phpt
7.29
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_bit.phpt
1.76
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_class_constants.phpt
2.98
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_commit.phpt
3.2
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_connect_attr.phpt
1.9
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_connect_charset.phpt
1.08
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_errorcode.phpt
2.22
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_errorinfo.phpt
3.25
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_exec.phpt
7.25
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_exec_ddl.phpt
2.78
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_exec_load_data.phpt
3.6
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_exec_select.phpt
2.57
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_fetch_both.phpt
1.74
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_get_attribute.phpt
2.82
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_interface.phpt
1.45
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_last_insert_id.phpt
4.2
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_local_infile_default_off.phpt
668
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_local_infile_set_on.phpt
693
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_multi_stmt_nextrowset.phpt
4.98
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_param_str_natl.phpt
1.04
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_pconnect.phpt
3.23
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_phpinfo.phpt
738
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_emulated.phpt
13.92
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_emulated_anonymous.phpt
2.5
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
2.67
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_match_against.phpt
1.42
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native.phpt
12.8
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_clear_error.phpt
3.31
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_column.phpt
1.28
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_dup_named_placeholder.phpt
4.11
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_mixed_style.phpt
1.39
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_named_placeholder.phpt
2.8
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_prepare_native_placeholder_everywhere.phpt
2.59
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_quote.phpt
1.07
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_rollback.phpt
2.78
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_bindcolumn.phpt
4.05
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_bindparam.phpt
5.19
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_bindparam_types.phpt
7.46
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_bindvalue.phpt
11.76
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_blobfromsteam.phpt
3.94
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_blobs.phpt
2.63
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_closecursor.phpt
6.9
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_closecursor_empty.phpt
2.18
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_columncount.phpt
1.91
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_errorcode.phpt
1.88
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_errorinfo.phpt
3.19
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_fetch_non_select.phpt
6.05
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_fetch_serialize.phpt
4.19
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_fetch_serialize_simple.phpt
2.96
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_fetchobject.phpt
2.68
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_getcolumnmeta.phpt
12.94
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_multiquery.phpt
2.47
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_nextrowset.phpt
5.75
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_rowcount.phpt
933
B
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_unbuffered_2050.phpt
4.77
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_stmt_variable_columncount.phpt
4.01
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_subclass.phpt
2.32
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_types.phpt
6.83
KB
-rw-rw-r--
2022-10-31 11:36
pdo_mysql_types_zerofill.phpt
4.37
KB
-rw-rw-r--
2022-10-31 11:36
pecl_bug_5200.phpt
968
B
-rw-rw-r--
2022-10-31 11:36
pecl_bug_5780.phpt
1.5
KB
-rw-rw-r--
2022-10-31 11:36
pecl_bug_5802.phpt
1.33
KB
-rw-rw-r--
2022-10-31 11:36
show_tables.phpt
480
B
-rw-rw-r--
2022-10-31 11:36
skipif.inc
112
B
-rw-rw-r--
2022-10-31 11:36
table.inc
399
B
-rw-rw-r--
2022-10-31 11:36
Save
Rename
--TEST-- MySQL: PDOStatement->getColumnMeta() --SKIPIF-- <?php require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc'); require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); MySQLPDOTest::skip(); // Too many differences among MySQL version - run only with a recent one $db = MySQLPDOTest::factory(); $stmt = $db->query('SELECT VERSION() as _version'); $row = $stmt->fetch(PDO::FETCH_ASSOC); $version = ((int)substr($row['_version'], 0, 1) * 10) + (int)substr($row['_version'], 2, 1); if ($version < 51) die("skip Test needs MySQL 5.1+"); ?> --FILE-- <?php require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); MySQLPDOTest::createTestTable($db); try { $stmt = $db->prepare('SELECT id FROM test ORDER BY id ASC'); // execute() has not been called yet // NOTE: no warning if (false !== ($tmp = $stmt->getColumnMeta(0))) printf("[002] Expecting false got %s\n", var_export($tmp, true)); $stmt->execute(); // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 0 given in if (false !== ($tmp = @$stmt->getColumnMeta())) printf("[003] Expecting false got %s\n", var_export($tmp, true)); // invalid offset if (false !== ($tmp = @$stmt->getColumnMeta(-1))) printf("[004] Expecting false got %s\n", var_export($tmp, true)); // Warning: PDOStatement::getColumnMeta() expects parameter 1 to be int, array given in if (false !== ($tmp = @$stmt->getColumnMeta(array()))) printf("[005] Expecting false got %s\n", var_export($tmp, true)); // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 2 given in if (false !== ($tmp = @$stmt->getColumnMeta(1, 1))) printf("[006] Expecting false got %s\n", var_export($tmp, true)); $emulated = $stmt->getColumnMeta(0); printf("Testing native PS...\n"); $db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, 0); if (0 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY)) printf("[007] Unable to turn off emulated prepared statements\n"); $stmt = $db->prepare('SELECT id FROM test ORDER BY id ASC'); $stmt->execute(); $native = $stmt->getColumnMeta(0); if (count($native) == 0) { printf("[008] Meta data seems wrong, %s / %s\n", var_export($native, true), var_export($emulated, true)); } // invalid offset if (false !== ($tmp = $stmt->getColumnMeta(1))) printf("[009] Expecting false because of invalid offset got %s\n", var_export($tmp, true)); function test_meta(&$db, $offset, $sql_type, $value, $native_type, $pdo_type) { $db->exec('DROP TABLE IF EXISTS test'); $sql = sprintf('CREATE TABLE test(id INT, label %s) ENGINE=%s', $sql_type, MySQLPDOTest::getTableEngine()); if (!($stmt = @$db->prepare($sql)) || (!@$stmt->execute())) { // Some engines and/or MySQL server versions might not support the data type return true; } if (!$db->exec(sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $value))) { printf("[%03d] + 1] Insert failed, %d - %s\n", $offset, $db->errorCode(), var_export($db->errorInfo(), true)); return false; } $stmt = $db->prepare('SELECT id, label FROM test'); $stmt->execute(); $meta = $stmt->getColumnMeta(1); $row = $stmt->fetch(PDO::FETCH_ASSOC); if (empty($meta)) { printf("[%03d + 2] getColumnMeta() failed, %d - %s\n", $offset, $stmt->errorCode(), var_export($stmt->errorInfo(), true)); return false; } $elements = array('flags', 'table', 'name', 'len', 'precision', 'pdo_type'); foreach ($elements as $k => $element) if (!isset($meta[$element])) { printf("[%03d + 3] Element %s missing, %s\n", $offset, $element, var_export($meta, true)); return false; } if (($meta['table'] != 'test') || ($meta['name'] != 'label')) { printf("[%03d + 4] Table or field name is wrong, %s\n", $offset, var_export($meta, true)); return false; } if (!is_null($native_type)) { if (!isset($meta['native_type'])) { printf("[%03d + 5] Element native_type missing, %s\n", $offset, var_export($meta, true)); return false; } if (!is_array($native_type)) $native_type = array($native_type); $found = false; foreach ($native_type as $k => $type) { if ($meta['native_type'] == $type) { $found = true; break; } } if (!$found) { printf("[%03d + 6] Expecting native type %s, %s\n", $offset, var_export($native_type, true), var_export($meta, true)); return false; } } if (!is_null($pdo_type) && ($meta['pdo_type'] != $pdo_type)) { printf("[%03d + 6] Expecting PDO type %s got %s (%s)\n", $offset, $pdo_type, var_export($meta, true), var_export($meta['native_type'])); return false; } return true; } $stmt = $db->prepare('SELECT @@sql_mode AS _mode'); $stmt->execute(); $row = $stmt->fetch(PDO::FETCH_ASSOC); $real_as_float = (false === stristr($row['_mode'], "REAL_AS_FLOAT")) ? false : true; $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); $is_mysqlnd = MySQLPDOTest::isPDOMySQLnd(); test_meta($db, 20, 'BIT(8)', 1, 'BIT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 30, 'TINYINT', -127, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 40, 'TINYINT UNSIGNED', 255, 'TINY', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 50, 'BOOLEAN', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 60, 'SMALLINT', -32768, 'SHORT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 70, 'SMALLINT UNSIGNED', 65535, 'SHORT', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 80, 'MEDIUMINT', -8388608, 'INT24', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 90, 'MEDIUMINT UNSIGNED', 16777215, 'INT24', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 100, 'INT', -2147483648, 'LONG', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 110, 'INT UNSIGNED', 4294967295, 'LONG', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 120, 'BIGINT', '-9223372036854775808', 'LONGLONG', ($is_mysqlnd) ? ((PHP_INT_SIZE == 4) ? PDO::PARAM_STR : PDO::PARAM_INT) : PDO::PARAM_STR); test_meta($db, 130, 'BIGINT UNSIGNED', '18446744073709551615', 'LONGLONG', ($is_mysqlnd) ? ((PHP_INT_SIZE == 4) ? PDO::PARAM_STR : PDO::PARAM_INT) : PDO::PARAM_STR); test_meta($db, 130, 'REAL', -1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR); test_meta($db, 140, 'REAL UNSIGNED', 1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR); test_meta($db, 150, 'REAL ZEROFILL', 1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR); test_meta($db, 160, 'REAL UNSIGNED ZEROFILL', 1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR); test_meta($db, 170, 'DOUBLE', -1.01, 'DOUBLE', PDO::PARAM_STR); test_meta($db, 180, 'DOUBLE UNSIGNED', 1.01, 'DOUBLE', PDO::PARAM_STR); test_meta($db, 190, 'DOUBLE ZEROFILL', 1.01, 'DOUBLE', PDO::PARAM_STR); test_meta($db, 200, 'DOUBLE UNSIGNED ZEROFILL', 1.01, 'DOUBLE', PDO::PARAM_STR); test_meta($db, 210, 'FLOAT', -1.01, 'FLOAT', PDO::PARAM_STR); test_meta($db, 220, 'FLOAT UNSIGNED', 1.01, 'FLOAT', PDO::PARAM_STR); test_meta($db, 230, 'FLOAT ZEROFILL', 1.01, 'FLOAT', PDO::PARAM_STR); test_meta($db, 240, 'FLOAT UNSIGNED ZEROFILL', 1.01, 'FLOAT', PDO::PARAM_STR); test_meta($db, 250, 'DECIMAL', -1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 260, 'DECIMAL UNSIGNED', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 270, 'DECIMAL ZEROFILL', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 280, 'DECIMAL UNSIGNED ZEROFILL', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 290, 'NUMERIC', -1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 300, 'NUMERIC UNSIGNED', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 310, 'NUMERIC ZEROFILL', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 320, 'NUMERIC UNSIGNED ZEROFILL', 1.01, array('DECIMAL', 'NEWDECIMAL'), PDO::PARAM_STR); test_meta($db, 330, 'DATE', '2008-04-23', array('DATE', 'NEWDATE'), PDO::PARAM_STR); test_meta($db, 340, 'TIME', '14:37:00', 'TIME', PDO::PARAM_STR); test_meta($db, 350, 'TIMESTAMP', '2008-03-23 14:38:00', 'TIMESTAMP', PDO::PARAM_STR); test_meta($db, 360, 'DATETIME', '2008-03-23 14:38:00', 'DATETIME', PDO::PARAM_STR); test_meta($db, 370, 'YEAR', '2008', 'YEAR', ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR); test_meta($db, 380, 'CHAR(1)', 'a', 'STRING', PDO::PARAM_STR); test_meta($db, 390, 'CHAR(10)', '0123456789', 'STRING', PDO::PARAM_STR); test_meta($db, 400, 'CHAR(255)', str_repeat('z', 255), 'STRING', PDO::PARAM_STR); test_meta($db, 410, 'VARCHAR(1)', 'a', 'VAR_STRING', PDO::PARAM_STR); test_meta($db, 420, 'VARCHAR(10)', '0123456789', 'VAR_STRING', PDO::PARAM_STR); test_meta($db, 430, 'VARCHAR(255)', str_repeat('z', 255), 'VAR_STRING', PDO::PARAM_STR); test_meta($db, 440, 'BINARY(1)', str_repeat('a', 1), 'STRING', PDO::PARAM_STR); test_meta($db, 450, 'BINARY(255)', str_repeat('b', 255), 'STRING', PDO::PARAM_STR); test_meta($db, 460, 'VARBINARY(1)', str_repeat('a', 1), 'VAR_STRING', PDO::PARAM_STR); test_meta($db, 470, 'VARBINARY(255)', str_repeat('b', 255), 'VAR_STRING', PDO::PARAM_STR); test_meta($db, 480, 'TINYBLOB', str_repeat('b', 255), 'BLOB', PDO::PARAM_STR); test_meta($db, 490, 'BLOB', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 500, 'MEDIUMBLOB', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 510, 'LONGBLOB', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 520, 'TINYTEXT', str_repeat('b', 255), 'BLOB', PDO::PARAM_STR); test_meta($db, 530, 'TINYTEXT BINARY', str_repeat('b', 255), 'BLOB', PDO::PARAM_STR); test_meta($db, 560, 'TEXT', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 570, 'TEXT BINARY', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 580, 'MEDIUMTEXT', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 590, 'MEDIUMTEXT BINARY', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 600, 'LONGTEXT', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 610, 'LONGTEXT BINARY', str_repeat('b', 256), 'BLOB', PDO::PARAM_STR); test_meta($db, 620, "ENUM('yes', 'no') DEFAULT 'yes'", 'no', NULL, PDO::PARAM_STR); test_meta($db, 630, "SET('yes', 'no') DEFAULT 'yes'", 'no', NULL, PDO::PARAM_STR); /* | spatial_type */ // unique key $db->exec('DROP TABLE IF EXISTS test'); $sql = sprintf('CREATE TABLE test(id INT, label INT UNIQUE) ENGINE = %s', MySQLPDOTest::getTableEngine()); if (($stmt = @$db->prepare($sql)) && @$stmt->execute()) { $db->exec('INSERT INTO test(id, label) VALUES (1, 2)'); $stmt = $db->query('SELECT id, label FROM test'); $meta = $stmt->getColumnMeta(1); if (!isset($meta['flags'])) { printf("[1000] No flags contained in metadata %s\n", var_export($meta, true)); } else { $flags = $meta['flags']; $found = false; foreach ($flags as $k => $flag) { if ($flag == 'unique_key') $found = true; } if (!$found) printf("[1001] Flags seem wrong %s\n", var_export($meta, true)); } } // primary key $db->exec('DROP TABLE IF EXISTS test'); $sql = sprintf('CREATE TABLE test(id INT PRIMARY KEY NOT NULL AUTO_INCREMENT) ENGINE = %s', MySQLPDOTest::getTableEngine()); if (($stmt = @$db->prepare($sql)) && @$stmt->execute()) { $db->exec('INSERT INTO test(id) VALUES (1)'); $stmt = $db->query('SELECT id FROM test'); $meta = $stmt->getColumnMeta(0); if (!isset($meta['flags'])) { printf("[1002] No flags contained in metadata %s\n", var_export($meta, true)); } else { $flags = $meta['flags']; $found = false; foreach ($flags as $k => $flag) { if ($flag == 'primary_key') $found = true; } if (!$found) printf("[1003] Flags seem wrong %s\n", var_export($meta, true)); } } // multiple key $db->exec('DROP TABLE IF EXISTS test'); $sql = sprintf('CREATE TABLE test(id INT, label1 INT, label2 INT, INDEX idx1(label1, label2)) ENGINE = %s', MySQLPDOTest::getTableEngine()); if (($stmt = @$db->prepare($sql)) && @$stmt->execute()) { $db->exec('INSERT INTO test(id, label1, label2) VALUES (1, 2, 3)'); $stmt = $db->query('SELECT id, label1, label2 FROM test'); $meta = $stmt->getColumnMeta(1); if (!isset($meta['flags'])) { printf("[1004] No flags contained in metadata %s\n", var_export($meta, true)); } else { $flags = $meta['flags']; $found = false; foreach ($flags as $k => $flag) { if ($flag == 'multiple_key') $found = true; } if (!$found) printf("[1005] Flags seem wrong %s\n", var_export($meta, true)); } } $stmt = $db->query('SELECT NULL AS col1'); $meta = $stmt->getColumnMeta(0); if ('NULL' !== $meta['native_type']) printf("[1006] Expecting NULL got %s\n", $meta['native_type']); } catch (PDOException $e) { // we should never get here, we use warnings, but never trust a system... printf("[001] %s, [%s} %s\n", $e->getMessage(), $db->errorInfo(), implode(' ', $db->errorInfo())); } $db->exec('DROP TABLE IF EXISTS test'); print "done!"; ?> --EXPECT-- Testing native PS... done!