Skip to content

Drop support for MYSQL_TEST_EXPERIMENTAL #15467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ext/mysqli/tests/connect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
ini_set('mysqli.default_socket', $socket);
}

/* Development setting: test experimental features and/or feature requests that never worked before? */
$TEST_EXPERIMENTAL = 1 == getenv("MYSQL_TEST_EXPERIMENTAL");

function get_environment_connection_flags(): int {
static $connect_flags = null;
if ($connect_flags === null) {
Expand Down
10 changes: 4 additions & 6 deletions ext/mysqli/tests/mysqli_class_mysqli_result_interface.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,10 @@ require_once 'skipifconnectfailure.inc';
$mode = mt_rand(-1000, 1000);
} while (in_array($mode, $valid));

if ($TEST_EXPERIMENTAL) {
ob_start();
try {
new mysqli_result($link, $mode);
$content = ob_get_contents();
ob_end_clean();
if (!stristr($content, 'Invalid value for resultmode'))
printf("[009] Expecting warning because of invalid resultmode\n");
} catch (ValueError $ex) {
echo $ex->getMessage(), "\n";
}

print "done!";
Expand Down Expand Up @@ -169,4 +166,5 @@ mysqli_result->unknown = ''

Constructor:
mysqli_result object is already closed
mysqli_result::__construct(): Argument #2 ($result_mode) must be either MYSQLI_STORE_RESULT or MYSQLI_USE_RESULT
done!
141 changes: 0 additions & 141 deletions ext/mysqli/tests/mysqli_get_warnings.phpt

This file was deleted.

16 changes: 9 additions & 7 deletions ext/mysqli/tests/mysqli_warning_unclonable.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ mysqli
--SKIPIF--
<?php
require_once 'skipifconnectfailure.inc';
if (!$TEST_EXPERIMENTAL)
die("skip - experimental (= unsupported) feature");
?>
--FILE--
<?php
Expand All @@ -16,15 +14,18 @@ if (!$TEST_EXPERIMENTAL)
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);

if (!mysqli_query($link, "SET sql_mode=''"))
printf("[002] Cannot set SQL-Mode, [%d] %s\n", mysqli_errno($mysql), mysqli_error($mysql));

if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

if (!mysqli_query($link, "CREATE TABLE test (id SMALLINT)"))
printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

if (!mysqli_query($link, "INSERT INTO test (id) VALUES (1000000)"))
if (!mysqli_query($link, "CREATE TABLE test (id SMALLINT NOT NULL)"))
printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

if (!mysqli_query($link, "INSERT INTO test (id) VALUES (1), (NULL)"))
printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link));

if (!is_object($warning = mysqli_get_warnings($link)) || 'mysqli_warning' != get_class($warning)) {
printf("[006] Expecting object/mysqli_warning, got %s/%s\n", gettype($warning), (is_object($warning) ? var_export($warning, true) : $warning));
}
Expand All @@ -37,4 +38,5 @@ if (!$TEST_EXPERIMENTAL)
require_once 'clean_table.inc';
?>
--EXPECTF--
Fatal error: Trying to clone an uncloneable object of class mysqli_warning in %s on line %d
Fatal error: Uncaught Error: Trying to clone an uncloneable object of class mysqli_warning in %s:%d
Stack trace:%A
2 changes: 0 additions & 2 deletions ext/mysqli/tests/test_setup/test_helpers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,4 @@ function setup_table_with_data_on_default_connection(string $table): mysqli {
return $link;
}

/* Development setting: test experimental features and/or feature requests that never worked before? */
//$TEST_EXPERIMENTAL = 1 == getenv("MYSQL_TEST_EXPERIMENTAL");
//$engine = getenv("MYSQL_TEST_ENGINE") ?: "InnoDB";
Loading