Skip to content

Commit 6572d91

Browse files
committed
Don't check TIMESTAMP NOT NULL in fetch_field_flags test
The behavior of this is very dependent on the MySQL vendor, MySQL version and MySQL configuration, in particular the explicit_defaults_for_timestamp variable. I don't think it's worthwhile to try and model this exactly, so drop the test.
1 parent c4cbdfa commit 6572d91

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

ext/mysqli/tests/mysqli_fetch_field_flags.phpt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ mysqli_close($link);
6060
'INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY' => 'NOT_NULL PRI_KEY UNSIGNED AUTO_INCREMENT NUM PART_KEY',
6161
'CHAR(1) DEFAULT NULL' => '',
6262
'CHAR(1) NOT NULL' => 'NOT_NULL NO_DEFAULT_VALUE',
63-
'TIMESTAMP NOT NULL' => 'NOT_NULL UNSIGNED ZEROFILL BINARY TIMESTAMP',
6463
'VARBINARY(127) DEFAULT NULL' => 'BINARY',
6564
'BLOB' => 'BLOB BINARY',
6665
'TINYBLOB' => 'BLOB BINARY',
@@ -106,13 +105,6 @@ mysqli_close($link);
106105
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
107106
printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
108107

109-
$is_maria_db = strpos(mysqli_get_server_info($link), "MariaDB") !== false;
110-
if ($is_maria_db) {
111-
$columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY UNSIGNED NOT_NULL';
112-
} else if (mysqli_get_server_version($link) > 50600) {
113-
$columns['TIMESTAMP NOT NULL'] = 'ON_UPDATE_NOW TIMESTAMP BINARY NOT_NULL';
114-
}
115-
116108
foreach ($columns as $column_def => $expected_flags) {
117109
if (!mysqli_query($link, 'DROP TABLE IF EXISTS test')) {
118110
printf("[002] %s [%d] %s\n", $column_def,
@@ -150,16 +142,6 @@ mysqli_close($link);
150142
results.The test does not yet fully reflect all server changes/bugs etc.
151143
*/
152144
switch ($column_def) {
153-
case 'TIMESTAMP NOT NULL':
154-
// http://bugs.mysql.com/bug.php?id=30081 - new flag introduced in 5.1.24/6.0.4
155-
$version = mysqli_get_server_version($link);
156-
if ((($version > 50122) && ($version < 60000) && ($version != 50200)) ||
157-
($version >= 60004)) {
158-
// new flag ON_UPDATE_NOW_FLAG (8192)
159-
$expected_flags .= ' ON_UPDATE_NOW';
160-
}
161-
break;
162-
163145
case 'INT UNSIGNED NOT NULL':
164146
case 'INT NOT NULL':
165147
case 'CHAR(1) NOT NULL':

0 commit comments

Comments
 (0)