Author: uwendel
Date: 2007-04-02 15:26:55 +0200 (Mon, 02 Apr 2007)
New Revision: 323
Added:
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_buf.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_unbuf.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_sel_unbuf.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_insert.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_seek_seq.php
trunk/tests/ext/mysqli/mysqli_stmt_packet_size_remote_mysqlnd.php
Removed:
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_buffered.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_unbuffered.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_select_varchar_unbuffered.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_data_seek_sequential.php
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_execute_insert_varchar.php
trunk/tests/ext/mysqli/mysqli_stmt_send_long_data_packet_size_remote_mysqlnd.phpt
Log:
Renaming some files. After adding five characters to the version string some filenames got
too long for the tar command when creating the release archive.
Deleted: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_buffered.php
===================================================================
---
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_buffered.php 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_buffered.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,137 +0,0 @@
-<?PHP
-// measured in KB, that means 1 = 1024 bytes
-$columns = array(1, 3, 5, 10, 15, 20, 30, 40, 50, 100, 300, 500);
-$column_types = array(
- array("len" => 1, "name" => "c_tinyint", "type" => "TINYINT",
"value" => 1),
- array("len" => 2, "name" => "c_smallint", "type" =>
"SMALLINT", "value" => 1),
- array("len" => 200, "name" => "c_varchar_199", "type" =>
"varchar(199)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 3, "name" => "c_mediumint", "type" =>
"MEDIUMINT", "value" => 1),
- array("len" => 20, "name" => "c_varchar_19", "type" =>
"varchar(19)", "value" => "0123456789012345678"),
- array("len" => 4, "name" => "c_int", "type" => "INT", "value"
=> 1),
- array("len" => 8, "name" => "c_bigint", "type" => "BIGINT",
"value" => 1),
- array("len" => 50, "name" => "c_varchar_49", "type" =>
"varchar(49)", "value" => "0123456789012345678901234567890123456789012345678"),
- array("len" => 4, "name" => "c_float_24", "type" =>
"FLOAT(24)", "value" => 1),
- array("len" => 150, "name" => "c_varchar_149", "type" =>
"varchar(149)", "value" =>
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 8, "name" => "c_float_25", "type" =>
"FLOAT(25)", "value" => 1),
- array("len" => 4, "name" => "c_float", "type" => "FLOAT",
"value" => 1),
- array("len" => 8, "name" => "c_double", "type" => "DOUBLE",
"value" => 1),
- array("len" => 100, "name" => "c_varchar_99", "type" =>
"varchar(99)", "value" =>
"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 3, "name" => "c_date", "type" => "DATE",
"value" => "2007-01-17"),
- array("len" => 8, "name" => "c_datetime", "type" =>
"DATETIME", "value" => "2007-01-17 11:53:00"),
- array("len" => 4, "name" => "c_timestamp", "type" =>
"TIMESTAMP", "value" => "2007-01-17 11:54:00"),
- array("len" => 3, "name" => "c_time", "type" => "TIME",
"value" => "11:54:00"),
- array("len" => 1, "name" => "c_year", "type" => "YEAR",
"value" => "2007"),
- array("len" => 10, "name" => "c_char_10", "type" =>
"CHAR(10)", "value" => "0123456789"),
- array("len" => 1, "name" => "c_enum", "type" => "ENUM('true',
'false')", "value" => "true"),
- // let's assume latin1
- array("len" => 300, "name" => "c_varchar_99", "type" =>
"varchar(298)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567"),
- );
-$rows = array(2000);
-
-
-foreach ($rows as $k => $num_rows) {
- foreach ($columns as $k => $num_columns) {
-
- $num_column_types = count($column_types);
- $total_len = 0;
- for ($i = 0; $i < $num_columns; $i++) {
- $total_len += $column_types[$i % $num_column_types]['len'];
- }
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = 0;
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] = 0;
- }
-}
-$description = 'Connect, create n-rows with one m-columns of different types, SELECT all
(buffered), close. n and m vary.';
-$errors = array();
-
-do {
-
- if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
- $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
- break;
- }
-
- foreach ($rows as $k => $num_rows) {
-
- foreach ($columns as $k => $num_columns) {
-
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
- $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $num_column_types = count($column_types);
- $total_len = 0;
- $column_names = $column_defs = $column_values = '';
- for ($i = 0; $i < $num_columns; $i++) {
- $index = $i % $num_column_types;
- $total_len += $column_types[$index]['len'];
- $column_names .= sprintf("%s_%d, ", $column_types[$index]['name'], $i);
- $column_defs .= sprintf("%s_%d %s, ", $column_types[$index]['name'], $i,
$column_types[$index]['type']);
- $column_values .= sprintf("%s%s%s, ",
- (is_string($column_types[$index]['value'])) ? '"' : '',
- $column_types[$index]['value'],
- (is_string($column_types[$index]['value'])) ? '"' : ''
- );
- }
- $last_column = sprintf("%s_%d", $column_types[$index]['name'], $i - 1);
- $last_value = $column_types[$index]['value'];
-
- $sql = sprintf("CREATE TABLE test(%s)", substr($column_defs, 0, -2));
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $sql = sprintf("INSERT INTO test(%s) VALUES (%s)", substr($column_names, 0, -2),
substr($column_values, 0, -2));
- for ($i = 0; $i < $num_rows; $i++) {
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 4;
- }
- }
-
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true);
- if (!$res = mysqli_query($link, 'SELECT * FROM test')) {
- $errors[] = sprintf("SELECT failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $start = microtime(true);
- while ($row = mysqli_fetch_assoc($res))
- if ($row[$last_column] != $last_value) {
- $errors[] = sprintf("fetch() failed (converted code: %s): [%d] %s\n",
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- var_dump($row);
- var_dump($last_column);
- var_dump($last_value);
- break 4;
-
- }
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] += (microtime(true) - $start);
-
- mysqli_free_result($res);
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true) - $times[$num_rows . ' row[s]: ' . $num_columns . '
column[s] (' . $total_len . ' bytes) overall'];
-
-
-
- }
- }
-
-
- mysqli_close($link);
-
-} while (false);
-?>
\ No newline at end of file
Deleted:
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_unbuffered.php
===================================================================
---
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_unbuffered.php 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_fetch_many_columns_unbuffered.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,145 +0,0 @@
-<?PHP
-// measured in KB, that means 1 = 1024 bytes
-$columns = array(1, 3, 5, 10, 15, 20, 30, 40, 50, 100, 300, 500);
-$column_types = array(
- array("len" => 1, "name" => "c_tinyint", "type" => "TINYINT",
"value" => 1),
- array("len" => 2, "name" => "c_smallint", "type" =>
"SMALLINT", "value" => 1),
- array("len" => 200, "name" => "c_varchar_199", "type" =>
"varchar(199)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 3, "name" => "c_mediumint", "type" =>
"MEDIUMINT", "value" => 1),
- array("len" => 20, "name" => "c_varchar_19", "type" =>
"varchar(19)", "value" => "0123456789012345678"),
- array("len" => 4, "name" => "c_int", "type" => "INT", "value"
=> 1),
- array("len" => 8, "name" => "c_bigint", "type" => "BIGINT",
"value" => 1),
- array("len" => 50, "name" => "c_varchar_49", "type" =>
"varchar(49)", "value" => "0123456789012345678901234567890123456789012345678"),
- array("len" => 4, "name" => "c_float_24", "type" =>
"FLOAT(24)", "value" => 1),
- array("len" => 150, "name" => "c_varchar_149", "type" =>
"varchar(149)", "value" =>
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 8, "name" => "c_float_25", "type" =>
"FLOAT(25)", "value" => 1),
- array("len" => 4, "name" => "c_float", "type" => "FLOAT",
"value" => 1),
- array("len" => 8, "name" => "c_double", "type" => "DOUBLE",
"value" => 1),
- array("len" => 100, "name" => "c_varchar_99", "type" =>
"varchar(99)", "value" =>
"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
- array("len" => 3, "name" => "c_date", "type" => "DATE",
"value" => "2007-01-17"),
- array("len" => 8, "name" => "c_datetime", "type" =>
"DATETIME", "value" => "2007-01-17 11:53:00"),
- array("len" => 4, "name" => "c_timestamp", "type" =>
"TIMESTAMP", "value" => "2007-01-17 11:54:00"),
- array("len" => 3, "name" => "c_time", "type" => "TIME",
"value" => "11:54:00"),
- array("len" => 1, "name" => "c_year", "type" => "YEAR",
"value" => "2007"),
- array("len" => 10, "name" => "c_char_10", "type" =>
"CHAR(10)", "value" => "0123456789"),
- array("len" => 1, "name" => "c_enum", "type" => "ENUM('true',
'false')", "value" => "true"),
- // let's assume latin1
- array("len" => 300, "name" => "c_varchar_99", "type" =>
"varchar(298)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567"),
- );
-$rows = array(2000);
-
-
-foreach ($rows as $k => $num_rows) {
- foreach ($columns as $k => $num_columns) {
-
- $num_column_types = count($column_types);
- $total_len = 0;
- for ($i = 0; $i < $num_columns; $i++) {
- $total_len += $column_types[$i % $num_column_types]['len'];
- }
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = 0;
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] = 0;
- }
-}
-$description = 'Connect, create n-rows with one m-columns of different types, SELECT all
(buffered), close. n and m vary.';
-$errors = array();
-
-do {
-
- if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
- $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
- break;
- }
-
- foreach ($rows as $k => $num_rows) {
-
- foreach ($columns as $k => $num_columns) {
-
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
- $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $num_column_types = count($column_types);
- $total_len = 0;
- $column_names = $column_defs = $column_values = '';
- for ($i = 0; $i < $num_columns; $i++) {
- $index = $i % $num_column_types;
- $total_len += $column_types[$index]['len'];
- $column_names .= sprintf("%s_%d, ", $column_types[$index]['name'], $i);
- $column_defs .= sprintf("%s_%d %s, ", $column_types[$index]['name'], $i,
$column_types[$index]['type']);
- $column_values .= sprintf("%s%s%s, ",
- (is_string($column_types[$index]['value'])) ? '"' : '',
- $column_types[$index]['value'],
- (is_string($column_types[$index]['value'])) ? '"' : ''
- );
- }
- $last_column = sprintf("%s_%d", $column_types[$index]['name'], $i - 1);
- $last_value = $column_types[$index]['value'];
-
- $sql = sprintf("CREATE TABLE test(%s)", substr($column_defs, 0, -2));
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $sql = sprintf("INSERT INTO test(%s) VALUES (%s)", substr($column_names, 0, -2),
substr($column_values, 0, -2));
- for ($i = 0; $i < $num_rows; $i++) {
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 4;
- }
- }
-
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true);
- if (!mysqli_real_query($link, 'SELECT * FROM test')) {
- $errors[] = sprintf("SELECT failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- if (!$res = mysqli_use_result($link)) {
- $errors[] = sprintf("use_result() failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $start = microtime(true);
- while ($row = mysqli_fetch_assoc($res))
- if ($row[$last_column] != $last_value) {
- $errors[] = sprintf("fetch() failed (converted code: %s): [%d] %s\n",
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- var_dump($row);
- var_dump($last_column);
- var_dump($last_value);
- break 4;
-
- }
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] += (microtime(true) - $start);
-
- mysqli_free_result($res);
- $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true) - $times[$num_rows . ' row[s]: ' . $num_columns . '
column[s] (' . $total_len . ' bytes) overall'];
-
-
-
- }
- }
-
-
- mysqli_close($link);
-
-} while (false);
-?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_buf.php
===================================================================
--- trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_buf.php 2007-04-02
13:04:17 UTC (rev 322)
+++ trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_buf.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -0,0 +1,137 @@
+<?PHP
+// measured in KB, that means 1 = 1024 bytes
+$columns = array(1, 3, 5, 10, 15, 20, 30, 40, 50, 100, 300, 500);
+$column_types = array(
+ array("len" => 1, "name" => "c_tinyint", "type" => "TINYINT",
"value" => 1),
+ array("len" => 2, "name" => "c_smallint", "type" =>
"SMALLINT", "value" => 1),
+ array("len" => 200, "name" => "c_varchar_199", "type" =>
"varchar(199)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 3, "name" => "c_mediumint", "type" =>
"MEDIUMINT", "value" => 1),
+ array("len" => 20, "name" => "c_varchar_19", "type" =>
"varchar(19)", "value" => "0123456789012345678"),
+ array("len" => 4, "name" => "c_int", "type" => "INT", "value"
=> 1),
+ array("len" => 8, "name" => "c_bigint", "type" => "BIGINT",
"value" => 1),
+ array("len" => 50, "name" => "c_varchar_49", "type" =>
"varchar(49)", "value" => "0123456789012345678901234567890123456789012345678"),
+ array("len" => 4, "name" => "c_float_24", "type" =>
"FLOAT(24)", "value" => 1),
+ array("len" => 150, "name" => "c_varchar_149", "type" =>
"varchar(149)", "value" =>
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 8, "name" => "c_float_25", "type" =>
"FLOAT(25)", "value" => 1),
+ array("len" => 4, "name" => "c_float", "type" => "FLOAT",
"value" => 1),
+ array("len" => 8, "name" => "c_double", "type" => "DOUBLE",
"value" => 1),
+ array("len" => 100, "name" => "c_varchar_99", "type" =>
"varchar(99)", "value" =>
"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 3, "name" => "c_date", "type" => "DATE",
"value" => "2007-01-17"),
+ array("len" => 8, "name" => "c_datetime", "type" =>
"DATETIME", "value" => "2007-01-17 11:53:00"),
+ array("len" => 4, "name" => "c_timestamp", "type" =>
"TIMESTAMP", "value" => "2007-01-17 11:54:00"),
+ array("len" => 3, "name" => "c_time", "type" => "TIME",
"value" => "11:54:00"),
+ array("len" => 1, "name" => "c_year", "type" => "YEAR",
"value" => "2007"),
+ array("len" => 10, "name" => "c_char_10", "type" =>
"CHAR(10)", "value" => "0123456789"),
+ array("len" => 1, "name" => "c_enum", "type" => "ENUM('true',
'false')", "value" => "true"),
+ // let's assume latin1
+ array("len" => 300, "name" => "c_varchar_99", "type" =>
"varchar(298)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567"),
+ );
+$rows = array(2000);
+
+
+foreach ($rows as $k => $num_rows) {
+ foreach ($columns as $k => $num_columns) {
+
+ $num_column_types = count($column_types);
+ $total_len = 0;
+ for ($i = 0; $i < $num_columns; $i++) {
+ $total_len += $column_types[$i % $num_column_types]['len'];
+ }
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = 0;
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] = 0;
+ }
+}
+$description = 'Connect, create n-rows with one m-columns of different types, SELECT all
(buffered), close. n and m vary.';
+$errors = array();
+
+do {
+
+ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
+ break;
+ }
+
+ foreach ($rows as $k => $num_rows) {
+
+ foreach ($columns as $k => $num_columns) {
+
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
+ $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $num_column_types = count($column_types);
+ $total_len = 0;
+ $column_names = $column_defs = $column_values = '';
+ for ($i = 0; $i < $num_columns; $i++) {
+ $index = $i % $num_column_types;
+ $total_len += $column_types[$index]['len'];
+ $column_names .= sprintf("%s_%d, ", $column_types[$index]['name'], $i);
+ $column_defs .= sprintf("%s_%d %s, ", $column_types[$index]['name'], $i,
$column_types[$index]['type']);
+ $column_values .= sprintf("%s%s%s, ",
+ (is_string($column_types[$index]['value'])) ? '"' : '',
+ $column_types[$index]['value'],
+ (is_string($column_types[$index]['value'])) ? '"' : ''
+ );
+ }
+ $last_column = sprintf("%s_%d", $column_types[$index]['name'], $i - 1);
+ $last_value = $column_types[$index]['value'];
+
+ $sql = sprintf("CREATE TABLE test(%s)", substr($column_defs, 0, -2));
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $sql = sprintf("INSERT INTO test(%s) VALUES (%s)", substr($column_names, 0, -2),
substr($column_values, 0, -2));
+ for ($i = 0; $i < $num_rows; $i++) {
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 4;
+ }
+ }
+
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true);
+ if (!$res = mysqli_query($link, 'SELECT * FROM test')) {
+ $errors[] = sprintf("SELECT failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $start = microtime(true);
+ while ($row = mysqli_fetch_assoc($res))
+ if ($row[$last_column] != $last_value) {
+ $errors[] = sprintf("fetch() failed (converted code: %s): [%d] %s\n",
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ var_dump($row);
+ var_dump($last_column);
+ var_dump($last_value);
+ break 4;
+
+ }
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] += (microtime(true) - $start);
+
+ mysqli_free_result($res);
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true) - $times[$num_rows . ' row[s]: ' . $num_columns . '
column[s] (' . $total_len . ' bytes) overall'];
+
+
+
+ }
+ }
+
+
+ mysqli_close($link);
+
+} while (false);
+?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_unbuf.php
===================================================================
--- trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_unbuf.php 2007-04-02
13:04:17 UTC (rev 322)
+++ trunk/tests/ext/mysqli/bench/micro_benches/mysqli_many_cols_unbuf.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -0,0 +1,145 @@
+<?PHP
+// measured in KB, that means 1 = 1024 bytes
+$columns = array(1, 3, 5, 10, 15, 20, 30, 40, 50, 100, 300, 500);
+$column_types = array(
+ array("len" => 1, "name" => "c_tinyint", "type" => "TINYINT",
"value" => 1),
+ array("len" => 2, "name" => "c_smallint", "type" =>
"SMALLINT", "value" => 1),
+ array("len" => 200, "name" => "c_varchar_199", "type" =>
"varchar(199)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 3, "name" => "c_mediumint", "type" =>
"MEDIUMINT", "value" => 1),
+ array("len" => 20, "name" => "c_varchar_19", "type" =>
"varchar(19)", "value" => "0123456789012345678"),
+ array("len" => 4, "name" => "c_int", "type" => "INT", "value"
=> 1),
+ array("len" => 8, "name" => "c_bigint", "type" => "BIGINT",
"value" => 1),
+ array("len" => 50, "name" => "c_varchar_49", "type" =>
"varchar(49)", "value" => "0123456789012345678901234567890123456789012345678"),
+ array("len" => 4, "name" => "c_float_24", "type" =>
"FLOAT(24)", "value" => 1),
+ array("len" => 150, "name" => "c_varchar_149", "type" =>
"varchar(149)", "value" =>
"1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 8, "name" => "c_float_25", "type" =>
"FLOAT(25)", "value" => 1),
+ array("len" => 4, "name" => "c_float", "type" => "FLOAT",
"value" => 1),
+ array("len" => 8, "name" => "c_double", "type" => "DOUBLE",
"value" => 1),
+ array("len" => 100, "name" => "c_varchar_99", "type" =>
"varchar(99)", "value" =>
"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678"),
+ array("len" => 3, "name" => "c_date", "type" => "DATE",
"value" => "2007-01-17"),
+ array("len" => 8, "name" => "c_datetime", "type" =>
"DATETIME", "value" => "2007-01-17 11:53:00"),
+ array("len" => 4, "name" => "c_timestamp", "type" =>
"TIMESTAMP", "value" => "2007-01-17 11:54:00"),
+ array("len" => 3, "name" => "c_time", "type" => "TIME",
"value" => "11:54:00"),
+ array("len" => 1, "name" => "c_year", "type" => "YEAR",
"value" => "2007"),
+ array("len" => 10, "name" => "c_char_10", "type" =>
"CHAR(10)", "value" => "0123456789"),
+ array("len" => 1, "name" => "c_enum", "type" => "ENUM('true',
'false')", "value" => "true"),
+ // let's assume latin1
+ array("len" => 300, "name" => "c_varchar_99", "type" =>
"varchar(298)", "value" =>
"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567"),
+ );
+$rows = array(2000);
+
+
+foreach ($rows as $k => $num_rows) {
+ foreach ($columns as $k => $num_columns) {
+
+ $num_column_types = count($column_types);
+ $total_len = 0;
+ for ($i = 0; $i < $num_columns; $i++) {
+ $total_len += $column_types[$i % $num_column_types]['len'];
+ }
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = 0;
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] = 0;
+ }
+}
+$description = 'Connect, create n-rows with one m-columns of different types, SELECT all
(buffered), close. n and m vary.';
+$errors = array();
+
+do {
+
+ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
+ break;
+ }
+
+ foreach ($rows as $k => $num_rows) {
+
+ foreach ($columns as $k => $num_columns) {
+
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
+ $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $num_column_types = count($column_types);
+ $total_len = 0;
+ $column_names = $column_defs = $column_values = '';
+ for ($i = 0; $i < $num_columns; $i++) {
+ $index = $i % $num_column_types;
+ $total_len += $column_types[$index]['len'];
+ $column_names .= sprintf("%s_%d, ", $column_types[$index]['name'], $i);
+ $column_defs .= sprintf("%s_%d %s, ", $column_types[$index]['name'], $i,
$column_types[$index]['type']);
+ $column_values .= sprintf("%s%s%s, ",
+ (is_string($column_types[$index]['value'])) ? '"' : '',
+ $column_types[$index]['value'],
+ (is_string($column_types[$index]['value'])) ? '"' : ''
+ );
+ }
+ $last_column = sprintf("%s_%d", $column_types[$index]['name'], $i - 1);
+ $last_value = $column_types[$index]['value'];
+
+ $sql = sprintf("CREATE TABLE test(%s)", substr($column_defs, 0, -2));
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $sql = sprintf("INSERT INTO test(%s) VALUES (%s)", substr($column_names, 0, -2),
substr($column_values, 0, -2));
+ for ($i = 0; $i < $num_rows; $i++) {
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("%s failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 4;
+ }
+ }
+
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true);
+ if (!mysqli_real_query($link, 'SELECT * FROM test')) {
+ $errors[] = sprintf("SELECT failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ if (!$res = mysqli_use_result($link)) {
+ $errors[] = sprintf("use_result() failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $start = microtime(true);
+ while ($row = mysqli_fetch_assoc($res))
+ if ($row[$last_column] != $last_value) {
+ $errors[] = sprintf("fetch() failed (converted code: %s): [%d] %s\n",
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ var_dump($row);
+ var_dump($last_column);
+ var_dump($last_value);
+ break 4;
+
+ }
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) fetch()'] += (microtime(true) - $start);
+
+ mysqli_free_result($res);
+ $times[$num_rows . ' row[s]: ' . $num_columns . ' column[s] (' . $total_len . '
bytes) overall'] = microtime(true) - $times[$num_rows . ' row[s]: ' . $num_columns . '
column[s] (' . $total_len . ' bytes) overall'];
+
+
+
+ }
+ }
+
+
+ mysqli_close($link);
+
+} while (false);
+?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_sel_unbuf.php
===================================================================
--- trunk/tests/ext/mysqli/bench/micro_benches/mysqli_sel_unbuf.php 2007-04-02 13:04:17
UTC (rev 322)
+++ trunk/tests/ext/mysqli/bench/micro_benches/mysqli_sel_unbuf.php 2007-04-02 13:26:55
UTC (rev 323)
@@ -0,0 +1,114 @@
+<?PHP
+$runs = array(10, 100);
+$rows = array(100, 1000);
+$types = array(
+ 127 => 'varchar(127)',
+ 255 => 'varchar(255)',
+ 512 => 'varchar(512)',
+ 1024 => 'varchar(1024)',
+ 2048 => 'varchar(2048)',
+ 4096 => 'varchar(4096)',
+ 8192 => 'varchar(8192)',
+ 16384 => 'varchar(16384)',
+ 32768 => 'varchar(32768)',
+ 65000 => 'varchar(65000)',
+ );
+$times = array();
+foreach ($rows as $k => $num_rows) {
+ foreach ($runs as $k => $run) {
+ foreach ($types as $len => $type) {
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x query()'] = 0;
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] = 0;
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x fetch_assoc()'] = 0;
+ }
+ }
+}
+$description = 'Connect, create n rows with varchar of size m, o-times SELECT all rows
(unbuffered), close. n, m, o vary.';
+$errors = array();
+
+function mysqli_query_select_varchar_unbuffered($type, $len, $runs, $rows, $host, $user,
$passwd, $db, $port, $socket, $flag_original_code) {
+
+ $errors = $times = array();
+
+ foreach ($rows as $k => $num_rows) {
+
+ foreach ($runs as $k => $run) {
+
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] =
microtime(true);
+
+ do {
+ if (!$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ $errors[] = sprintf("%d rows: SELECT %s %dx connect failure (original code =
%s)",
+ $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no');
+ break 3;
+ }
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
+ $errors[] = sprintf("%d rows: SELECT %s %dx drop table failure (original code =
%s): [%d] %s",
+ $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no', mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL
AUTO_INCREMENT PRIMARY KEY, label %s)", $type))) {
+ $errors[] = sprintf("%d rows: SELECT %s %dx create table failure (original code
= %s): [%d] %s",
+ $num_rows, $type, $run, ($flag_original_code) ?
'yes' : 'no', mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+
+ $label = '';
+ for ($i = 0; $i < $len; $i++)
+ $label .= chr(mt_rand(65, 90));
+ $label = mysqli_real_escape_string($link, $label);
+
+ for ($i = 1; $i <= $num_rows; $i++) {
+ if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES ($i, '$label')"))
{
+ $errors[] = sprintf("%d rows: SELECT %s %dx insert failure (original code =
%s): [%d] %s",
+ $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no', mysqli_errno($link), mysqli_error($link));
+ break 3;
+ }
+ }
+
+ for ($i = 0; $i < $run; $i++) {
+
+ $start = microtime(true);
+ mysqli_real_query($link, "SELECT id, label FROM test");
+ $res = mysqli_use_result($link);
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x query()'] +=
(microtime(true) - $start);
+
+ if (!$res) {
+ $errors[] = sprintf("%d rows: SELECT %s %dx insert failure (original code =
%s): [%d] %s",
+ $rows, $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
+ break 4;
+ }
+
+ $start = microtime(true);
+ while ($row = mysqli_fetch_assoc($res))
+ ;
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x fetch_assoc()']
+= (microtime(true) - $start);
+
+ }
+
+ mysqli_close($link);
+
+ } while (false);
+
+ $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] =
microtime(true) - $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x
overall'];
+
+ }
+
+ }
+
+ return array($errors, $times);
+}
+
+
+foreach ($types as $len => $type) {
+ list ($errors, $tmp_times) = mysqli_query_select_varchar_unbuffered($type, $len,
$runs, $rows, $host, $user, $passwd, $db, $port, $socket, $flag_original_code);
+ $times = array_merge($times, $tmp_times);
+ if (!empty($errors)) {
+ break;
+ }
+}
+
+// sort by labels
+ksort($times);
+?>
Deleted: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_select_varchar_unbuffered.php
===================================================================
---
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_select_varchar_unbuffered.php 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_select_varchar_unbuffered.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,114 +0,0 @@
-<?PHP
-$runs = array(10, 100);
-$rows = array(100, 1000);
-$types = array(
- 127 => 'varchar(127)',
- 255 => 'varchar(255)',
- 512 => 'varchar(512)',
- 1024 => 'varchar(1024)',
- 2048 => 'varchar(2048)',
- 4096 => 'varchar(4096)',
- 8192 => 'varchar(8192)',
- 16384 => 'varchar(16384)',
- 32768 => 'varchar(32768)',
- 65000 => 'varchar(65000)',
- );
-$times = array();
-foreach ($rows as $k => $num_rows) {
- foreach ($runs as $k => $run) {
- foreach ($types as $len => $type) {
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x query()'] = 0;
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] = 0;
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x fetch_assoc()'] = 0;
- }
- }
-}
-$description = 'Connect, create n rows with varchar of size m, o-times SELECT all rows
(unbuffered), close. n, m, o vary.';
-$errors = array();
-
-function mysqli_query_select_varchar_unbuffered($type, $len, $runs, $rows, $host, $user,
$passwd, $db, $port, $socket, $flag_original_code) {
-
- $errors = $times = array();
-
- foreach ($rows as $k => $num_rows) {
-
- foreach ($runs as $k => $run) {
-
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] =
microtime(true);
-
- do {
- if (!$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
- $errors[] = sprintf("%d rows: SELECT %s %dx connect failure (original code =
%s)",
- $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no');
- break 3;
- }
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
- $errors[] = sprintf("%d rows: SELECT %s %dx drop table failure (original code =
%s): [%d] %s",
- $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no', mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL
AUTO_INCREMENT PRIMARY KEY, label %s)", $type))) {
- $errors[] = sprintf("%d rows: SELECT %s %dx create table failure (original code
= %s): [%d] %s",
- $num_rows, $type, $run, ($flag_original_code) ?
'yes' : 'no', mysqli_errno($link), mysqli_error($link));
- break 3;
- }
-
- $label = '';
- for ($i = 0; $i < $len; $i++)
- $label .= chr(mt_rand(65, 90));
- $label = mysqli_real_escape_string($link, $label);
-
- for ($i = 1; $i <= $num_rows; $i++) {
- if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES ($i, '$label')"))
{
- $errors[] = sprintf("%d rows: SELECT %s %dx insert failure (original code =
%s): [%d] %s",
- $num_rows, $type, $run, ($flag_original_code) ? 'yes' :
'no', mysqli_errno($link), mysqli_error($link));
- break 3;
- }
- }
-
- for ($i = 0; $i < $run; $i++) {
-
- $start = microtime(true);
- mysqli_real_query($link, "SELECT id, label FROM test");
- $res = mysqli_use_result($link);
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x query()'] +=
(microtime(true) - $start);
-
- if (!$res) {
- $errors[] = sprintf("%d rows: SELECT %s %dx insert failure (original code =
%s): [%d] %s",
- $rows, $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
- break 4;
- }
-
- $start = microtime(true);
- while ($row = mysqli_fetch_assoc($res))
- ;
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x fetch_assoc()']
+= (microtime(true) - $start);
-
- }
-
- mysqli_close($link);
-
- } while (false);
-
- $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x overall'] =
microtime(true) - $times[$num_rows . ' rows: SELECT ' . $type . ' ' . $run . 'x
overall'];
-
- }
-
- }
-
- return array($errors, $times);
-}
-
-
-foreach ($types as $len => $type) {
- list ($errors, $tmp_times) = mysqli_query_select_varchar_unbuffered($type, $len,
$runs, $rows, $host, $user, $passwd, $db, $port, $socket, $flag_original_code);
- $times = array_merge($times, $tmp_times);
- if (!empty($errors)) {
- break;
- }
-}
-
-// sort by labels
-ksort($times);
-?>
Deleted: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_data_seek_sequential.php
===================================================================
---
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_data_seek_sequential.php 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_data_seek_sequential.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,147 +0,0 @@
-<?PHP
-$runs = array(10, 100);
-$rows = array(100, 1000);
-$types = array(
- 16 => 'varchar(16)',
- 32 => 'varchar(32)',
- 64 => 'varchar(64)',
- 128 => 'varchar(128)',
- 256 => 'varchar(256)',
- 512 => 'varchar(512)',
- 1024 => 'varchar(1024)',
- 2048 => 'varchar(2048)',
- 4192 => 'varchar(4192)',
- 8384 => 'varchar(8384)',
- 16768 => 'varchar(16768)',
- 33536 => 'varchar(33536)',
- 65500 => 'varchar(65500)'
-
- );
-foreach ($runs as $k => $num_runs) {
- foreach ($rows as $k => $num_rows) {
- foreach ($types as $len => $type) {
- $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] = 0;
- $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' data_seek()'] = 0;
- }
- }
-}
-$description = 'Connect, create n-rows with varchar(m), SELECT all, fetch them in reverse
order using o-times [$runs] mysqli_stmt_data_seek(n...0), close. n, m and o vary.';
-$errors = array();$errors = array();
-
-do {
-
- if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
- $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
- break;
- }
-
- foreach ($types as $len => $type) {
-
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
- $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 2;
- }
-
- $sql = sprintf("CREATE TABLE test(id INT, label %s)", $type);
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("CREATE TABLE (%s) failed (converted code: %s): [%d] %s\n",
- $sql,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 2;
- }
-
- foreach ($rows as $k => $num_rows) {
- foreach ($runs as $k => $num_runs) {
-
- // create n-rows
- if (!mysqli_query($link, "DELETE FROM test")) {
- $errors[] = sprintf("DELETE failed (%s) (converted code: %s): [%d] %s\n",
- $type,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 4;
- }
-
- $label = str_repeat('a', $len);
- for ($i = 0; $i < $num_rows; $i++) {
- $sql = sprintf("INSERT INTO test(id, label) VALUES (%d, '%s')", $i, $label);
- if (!mysqli_query($link, $sql)) {
- $errors[] = sprintf("INSERT failed (%s) (converted code: %s): [%d] %s\n",
- $type,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_errno($link), mysqli_error($link));
- break 5;
- }
- }
-
- if (!$stmt = mysqli_stmt_init($link)) {
- $errors[] = sprintf("stmt_init() failed (converted code: %s)\n",
- ($flag_original_code) ? 'no' : 'yes');
- break 4;
- }
- if (!mysqli_stmt_prepare($stmt, 'SELECT id, label FROM test ORDER BY id')) {
- $errors[] = sprintf("stmt_prepare() failed (converted code: %s)\n",
- ($flag_original_code) ? 'no' : 'yes');
- break 4;
- }
- if (!mysqli_stmt_execute($stmt)) {
- $errors[] = sprintf("stmt_execute() failed (converted code: %s)\n",
- ($flag_original_code) ? 'no' : 'yes');
- break 4;
- }
- $id = $label = null;
- if (!mysqli_stmt_bind_result($stmt, $id, $label)) {
- $errors[] = sprintf("stmt_bind_result() failed (converted code: %s)\n",
- ($flag_original_code) ? 'no' : 'yes');
- break 4;
- }
- if (!mysqli_stmt_store_result($stmt)) {
- $errors[] = sprintf("stmt_store_result() failed (converted code: %s)\n",
- ($flag_original_code) ? 'no' : 'yes');
- break 4;
- }
-
- $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] =
microtime(true);
- for ($i = 0; $i < $num_runs; $i++) {
-
- $pos = $num_runs - $i - 1;
-
- $start = microtime(true);
- mysqli_stmt_data_seek($stmt, $pos);
- $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' data_seek()'] +=
(microtime(true) - $start);
-
- if (!mysqli_stmt_fetch($stmt)) {
- $errors[] = sprintf("fetch() for %dth of %d rows failed (%s) (converted code:
%s): [%d] %s\n",
- $pos, $num_rows, $type,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
- break 5;
- }
-
- if ($id != $pos) {
- $errors[] = sprintf("seek() + fetch() for %dth of %d rows did not work (%s)
(converted code: %s): [%d] %s\n",
- $pos, $num_rows, $type,
- ($flag_original_code) ? 'no' : 'yes',
- mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
- var_dump($id);
- var_dump($pos);
- break 5;
- }
-
- }
- $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] =
microtime(true) - $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'];
-
- mysqli_stmt_close($stmt);
- }
- }
-
- } // end foreach types
-
-
- mysqli_close($link);
-
-} while (false);
-?>
\ No newline at end of file
Deleted: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_execute_insert_varchar.php
===================================================================
---
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_execute_insert_varchar.php 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_execute_insert_varchar.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,95 +0,0 @@
-<?PHP
-$runs = array(1, 10, 100, 1000, 5000); // equals #rows
-$types = array(
- 127 => 'varchar(127)',
- 255 => 'varchar(255)',
- 512 => 'varchar(512)',
- 1024 => 'varchar(1024)',
- 2048 => 'varchar(2048)',
- 4096 => 'varchar(4096)',
- 8192 => 'varchar(8192)',
- 16384 => 'varchar(16384)',
- 32768 => 'varchar(32768)',
- );
-foreach ($runs as $k => $run) {
- foreach ($types as $len => $type) {
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows query()'] = 0;
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = 0;
- }
-}
-$description = 'Connect, n-times INSERT varchar of size m, close. n and m vary.';
-$errors = array();
-
-function mysqli_query_insert($type, $len, $runs, $host, $user, $passwd, $db, $port,
$socket) {
-
- $errors = $times = array();
-
- foreach ($runs as $k => $run) {
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = microtime(true);
- do {
- if (!$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
- $errors[] = sprintf("INSERT %s %dx = #rows connect failure (original code =
%s)", $type, $run, ($flag_original_code) ? 'yes' : 'no');
- break 2;
- }
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
- $errors[] = sprintf("INSERT %s %dx = #rows drop table failure (original code =
%s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
- break 2;
- }
-
- if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT
PRIMARY KEY, label %s)", $type))) {
- $errors[] = sprintf("INSERT %s %dx = #rows create table failure (original code =
%s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
- break 2;
- }
-
- $label = '';
- for ($i = 0; $i < $len; $i++)
- $label .= chr(mt_rand(65, 90));
-
- $start = microtime(true);
- if (!$stmt = mysqli_stmt_init($link)) {
- $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_init() failed (original
code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
- break 2;
- }
- $ret = mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (?, ?)");
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_init() + stmt_prepare()']
+= microtime(true) - $start;
- if (!$ret) {
- $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_init() failed (original
code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
- break 2;
- }
-
- $start = microtime(true);
- $ret = mysqli_stmt_bind_param($stmt, 'is', $i, $label);
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_bind_param()'] +=
microtime(true) - $start;
- if (!$ret) {
- $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_bind_param failed
(original code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
- break 2;
- }
-
- for ($i = 1; $i <= $run; $i++) {
- $start = microtime(true);
- $ret = mysqli_stmt_execute($stmt);
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_execute()'] +=
microtime(true) - $start;
- if (!$ret) {
- $errors[] = sprintf("INSERT %s %dx = #rows stmt_execute failure (original code
= %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
- break 3;
- }
- }
- mysqli_stmt_close($stmt);
- mysqli_close($link);
- } while (false);
- $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = microtime(true) -
$times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'];
- }
-
- return array($errors, $times);
-}
-
-
-ksort($types);
-foreach ($types as $len => $type) {
- list ($errors, $tmp_times) = mysqli_query_insert($type, $len, $runs, $host, $user,
$passwd, $db, $port, $socket);
- $times = array_merge($times, $tmp_times);
- if (!empty($errors)) {
- break;
- }
-}
-?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_insert.php
===================================================================
--- trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_insert.php 2007-04-02 13:04:17
UTC (rev 322)
+++ trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_insert.php 2007-04-02 13:26:55
UTC (rev 323)
@@ -0,0 +1,95 @@
+<?PHP
+$runs = array(1, 10, 100, 1000, 5000); // equals #rows
+$types = array(
+ 127 => 'varchar(127)',
+ 255 => 'varchar(255)',
+ 512 => 'varchar(512)',
+ 1024 => 'varchar(1024)',
+ 2048 => 'varchar(2048)',
+ 4096 => 'varchar(4096)',
+ 8192 => 'varchar(8192)',
+ 16384 => 'varchar(16384)',
+ 32768 => 'varchar(32768)',
+ );
+foreach ($runs as $k => $run) {
+ foreach ($types as $len => $type) {
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows query()'] = 0;
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = 0;
+ }
+}
+$description = 'Connect, n-times INSERT varchar of size m, close. n and m vary.';
+$errors = array();
+
+function mysqli_query_insert($type, $len, $runs, $host, $user, $passwd, $db, $port,
$socket) {
+
+ $errors = $times = array();
+
+ foreach ($runs as $k => $run) {
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = microtime(true);
+ do {
+ if (!$link = @mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ $errors[] = sprintf("INSERT %s %dx = #rows connect failure (original code =
%s)", $type, $run, ($flag_original_code) ? 'yes' : 'no');
+ break 2;
+ }
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
+ $errors[] = sprintf("INSERT %s %dx = #rows drop table failure (original code =
%s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
+ break 2;
+ }
+
+ if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT
PRIMARY KEY, label %s)", $type))) {
+ $errors[] = sprintf("INSERT %s %dx = #rows create table failure (original code =
%s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
+ break 2;
+ }
+
+ $label = '';
+ for ($i = 0; $i < $len; $i++)
+ $label .= chr(mt_rand(65, 90));
+
+ $start = microtime(true);
+ if (!$stmt = mysqli_stmt_init($link)) {
+ $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_init() failed (original
code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
+ break 2;
+ }
+ $ret = mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (?, ?)");
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_init() + stmt_prepare()']
+= microtime(true) - $start;
+ if (!$ret) {
+ $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_init() failed (original
code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
+ break 2;
+ }
+
+ $start = microtime(true);
+ $ret = mysqli_stmt_bind_param($stmt, 'is', $i, $label);
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_bind_param()'] +=
microtime(true) - $start;
+ if (!$ret) {
+ $error[] = sprintf("INSERT %s %dx = #rows mysqli_stmt_bind_param failed
(original code = %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no',
mysqli_errno($link), mysqli_error($link));
+ break 2;
+ }
+
+ for ($i = 1; $i <= $run; $i++) {
+ $start = microtime(true);
+ $ret = mysqli_stmt_execute($stmt);
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows stmt_execute()'] +=
microtime(true) - $start;
+ if (!$ret) {
+ $errors[] = sprintf("INSERT %s %dx = #rows stmt_execute failure (original code
= %s): [%d] %s", $type, $run, ($flag_original_code) ? 'yes' : 'no', mysqli_errno($link),
mysqli_error($link));
+ break 3;
+ }
+ }
+ mysqli_stmt_close($stmt);
+ mysqli_close($link);
+ } while (false);
+ $times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'] = microtime(true) -
$times['INSERT ' . $type . ' ' . $run . 'x = #rows overall'];
+ }
+
+ return array($errors, $times);
+}
+
+
+ksort($types);
+foreach ($types as $len => $type) {
+ list ($errors, $tmp_times) = mysqli_query_insert($type, $len, $runs, $host, $user,
$passwd, $db, $port, $socket);
+ $times = array_merge($times, $tmp_times);
+ if (!empty($errors)) {
+ break;
+ }
+}
+?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_seek_seq.php
===================================================================
--- trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_seek_seq.php 2007-04-02
13:04:17 UTC (rev 322)
+++ trunk/tests/ext/mysqli/bench/micro_benches/mysqli_stmt_seek_seq.php 2007-04-02
13:26:55 UTC (rev 323)
@@ -0,0 +1,147 @@
+<?PHP
+$runs = array(10, 100);
+$rows = array(100, 1000);
+$types = array(
+ 16 => 'varchar(16)',
+ 32 => 'varchar(32)',
+ 64 => 'varchar(64)',
+ 128 => 'varchar(128)',
+ 256 => 'varchar(256)',
+ 512 => 'varchar(512)',
+ 1024 => 'varchar(1024)',
+ 2048 => 'varchar(2048)',
+ 4192 => 'varchar(4192)',
+ 8384 => 'varchar(8384)',
+ 16768 => 'varchar(16768)',
+ 33536 => 'varchar(33536)',
+ 65500 => 'varchar(65500)'
+
+ );
+foreach ($runs as $k => $num_runs) {
+ foreach ($rows as $k => $num_rows) {
+ foreach ($types as $len => $type) {
+ $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] = 0;
+ $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' data_seek()'] = 0;
+ }
+ }
+}
+$description = 'Connect, create n-rows with varchar(m), SELECT all, fetch them in reverse
order using o-times [$runs] mysqli_stmt_data_seek(n...0), close. n, m and o vary.';
+$errors = array();$errors = array();
+
+do {
+
+ if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
+ $errors[] = sprintf("Connect failure (converted code: %s)\n", ($flag_original_code) ?
'no' : 'yes');
+ break;
+ }
+
+ foreach ($types as $len => $type) {
+
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test")) {
+ $errors[] = sprintf("DROP TABLE failed (converted code: %s): [%d] %s\n",
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 2;
+ }
+
+ $sql = sprintf("CREATE TABLE test(id INT, label %s)", $type);
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("CREATE TABLE (%s) failed (converted code: %s): [%d] %s\n",
+ $sql,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 2;
+ }
+
+ foreach ($rows as $k => $num_rows) {
+ foreach ($runs as $k => $num_runs) {
+
+ // create n-rows
+ if (!mysqli_query($link, "DELETE FROM test")) {
+ $errors[] = sprintf("DELETE failed (%s) (converted code: %s): [%d] %s\n",
+ $type,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 4;
+ }
+
+ $label = str_repeat('a', $len);
+ for ($i = 0; $i < $num_rows; $i++) {
+ $sql = sprintf("INSERT INTO test(id, label) VALUES (%d, '%s')", $i, $label);
+ if (!mysqli_query($link, $sql)) {
+ $errors[] = sprintf("INSERT failed (%s) (converted code: %s): [%d] %s\n",
+ $type,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_errno($link), mysqli_error($link));
+ break 5;
+ }
+ }
+
+ if (!$stmt = mysqli_stmt_init($link)) {
+ $errors[] = sprintf("stmt_init() failed (converted code: %s)\n",
+ ($flag_original_code) ? 'no' : 'yes');
+ break 4;
+ }
+ if (!mysqli_stmt_prepare($stmt, 'SELECT id, label FROM test ORDER BY id')) {
+ $errors[] = sprintf("stmt_prepare() failed (converted code: %s)\n",
+ ($flag_original_code) ? 'no' : 'yes');
+ break 4;
+ }
+ if (!mysqli_stmt_execute($stmt)) {
+ $errors[] = sprintf("stmt_execute() failed (converted code: %s)\n",
+ ($flag_original_code) ? 'no' : 'yes');
+ break 4;
+ }
+ $id = $label = null;
+ if (!mysqli_stmt_bind_result($stmt, $id, $label)) {
+ $errors[] = sprintf("stmt_bind_result() failed (converted code: %s)\n",
+ ($flag_original_code) ? 'no' : 'yes');
+ break 4;
+ }
+ if (!mysqli_stmt_store_result($stmt)) {
+ $errors[] = sprintf("stmt_store_result() failed (converted code: %s)\n",
+ ($flag_original_code) ? 'no' : 'yes');
+ break 4;
+ }
+
+ $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] =
microtime(true);
+ for ($i = 0; $i < $num_runs; $i++) {
+
+ $pos = $num_runs - $i - 1;
+
+ $start = microtime(true);
+ mysqli_stmt_data_seek($stmt, $pos);
+ $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' data_seek()'] +=
(microtime(true) - $start);
+
+ if (!mysqli_stmt_fetch($stmt)) {
+ $errors[] = sprintf("fetch() for %dth of %d rows failed (%s) (converted code:
%s): [%d] %s\n",
+ $pos, $num_rows, $type,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+ break 5;
+ }
+
+ if ($id != $pos) {
+ $errors[] = sprintf("seek() + fetch() for %dth of %d rows did not work (%s)
(converted code: %s): [%d] %s\n",
+ $pos, $num_rows, $type,
+ ($flag_original_code) ? 'no' : 'yes',
+ mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+ var_dump($id);
+ var_dump($pos);
+ break 5;
+ }
+
+ }
+ $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'] =
microtime(true) - $times[$num_rows . ' rows: ' . $num_runs . 'x ' . $type . ' overall'];
+
+ mysqli_stmt_close($stmt);
+ }
+ }
+
+ } // end foreach types
+
+
+ mysqli_close($link);
+
+} while (false);
+?>
\ No newline at end of file
Added: trunk/tests/ext/mysqli/mysqli_stmt_packet_size_remote_mysqlnd.php
===================================================================
--- trunk/tests/ext/mysqli/mysqli_stmt_packet_size_remote_mysqlnd.php 2007-04-02 13:04:17
UTC (rev 322)
+++ trunk/tests/ext/mysqli/mysqli_stmt_packet_size_remote_mysqlnd.php 2007-04-02 13:26:55
UTC (rev 323)
@@ -0,0 +1,78 @@
+--TEST--
+mysqli_stmt_send_long_data() - exceed packet size, remote via TCP/IP, mysqlnd
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+<?php
+require_once('skipifemb.inc');
+if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
+ die("skip warnings only available in mysqlnd");
+
+die("skip http://bugs.mysql.com/bug.php?id=26824 makes it fail always - TODO: reactivate
later");
+
+?>
+--FILE--
+<?php
+ include "connect.inc";
+ require('table.inc');
+
+ if (!$stmt = mysqli_stmt_init($link))
+ printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
+ printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT,
label LONGBLOB, PRIMARY KEY(id)) ENGINE = %s", $engine)))
+ printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (?, ?)"))
+ printf("[004] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+
+ $id = null;
+ $label = null;
+ if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label))
+ printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+
+ if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"'))
+ printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ if (!$row = mysqli_fetch_assoc($res))
+ printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
+
+ mysqli_free_result($res);
+
+ if (0 === ($max_allowed_packet = (int)$row['Value']))
+ printf("[008] Cannot determine max_allowed_packet size and/or bogus
max_allowed_packet setting used.\n");
+
+ // let's ignore upper limits for LONGBLOB (2^32) ...
+ // maximum packet size up to which we test is 10M
+ $tmp = '';
+ $blob = '';
+ $tmp = str_repeat('a', 1024);
+
+ $limit = floor($max_allowed_packet / 1024 / 2);
+ $blob = str_repeat($tmp, $limit);
+
+ $limit = $max_allowed_packet - strlen($blob) + 1;
+ $blob .= str_repeat('b', $limit);
+
+ assert(strlen($blob) > $max_allowed_packet);
+
+ if (false !== ($tmp = mysqli_stmt_send_long_data($stmt, 1, $blob)))
+ printf("[009] Expecting boolean/false, got %s/%s. [%d] %s\n",
+ gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+
+ $id = 1;
+ if (false !== ($tmp = mysqli_stmt_execute($stmt)))
+ printf("[010] Expecting boolean/false, got %s/%s, [%d] %s\n",
+ gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
+
+ mysqli_stmt_close($stmt);
+ mysqli_close($link);
+
+ print "done!";
+?>
+--EXPECTF--
+Warning: mysqli_stmt_send_long_data(): Skipped %d bytes. Last command STMT_SEND_LONG_DATA
hasn't consumed all the output from the server in %s on line %d
+
+Warning: mysqli_stmt_send_long_data(): There was an error while sending long data.
Probably max_allowed_packet_size is smaller than the data. You have to increase it or
send smaller chunks of data. Answer was %d bytes long. in %s on line %d
+done!
Deleted: trunk/tests/ext/mysqli/mysqli_stmt_send_long_data_packet_size_remote_mysqlnd.phpt
===================================================================
---
trunk/tests/ext/mysqli/mysqli_stmt_send_long_data_packet_size_remote_mysqlnd.phpt 2007-04-02
13:04:17 UTC (rev 322)
+++
trunk/tests/ext/mysqli/mysqli_stmt_send_long_data_packet_size_remote_mysqlnd.phpt 2007-04-02
13:26:55 UTC (rev 323)
@@ -1,78 +0,0 @@
---TEST--
-mysqli_stmt_send_long_data() - exceed packet size, remote via TCP/IP, mysqlnd
---SKIPIF--
-<?php require_once('skipif.inc'); ?>
-<?php
-require_once('skipifemb.inc');
-if (!stristr(mysqli_get_client_info(), 'mysqlnd'))
- die("skip warnings only available in mysqlnd");
-
-die("skip http://bugs.mysql.com/bug.php?id=26824 makes it fail always - TODO: reactivate
later");
-
-?>
---FILE--
-<?php
- include "connect.inc";
- require('table.inc');
-
- if (!$stmt = mysqli_stmt_init($link))
- printf("[001] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
- if (!mysqli_query($link, "DROP TABLE IF EXISTS test"))
- printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
- if (!mysqli_query($link, sprintf("CREATE TABLE test(id INT NOT NULL AUTO_INCREMENT,
label LONGBLOB, PRIMARY KEY(id)) ENGINE = %s", $engine)))
- printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
- if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (?, ?)"))
- printf("[004] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
-
- $id = null;
- $label = null;
- if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label))
- printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
-
- if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"'))
- printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
- if (!$row = mysqli_fetch_assoc($res))
- printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link));
-
- mysqli_free_result($res);
-
- if (0 === ($max_allowed_packet = (int)$row['Value']))
- printf("[008] Cannot determine max_allowed_packet size and/or bogus
max_allowed_packet setting used.\n");
-
- // let's ignore upper limits for LONGBLOB (2^32) ...
- // maximum packet size up to which we test is 10M
- $tmp = '';
- $blob = '';
- $tmp = str_repeat('a', 1024);
-
- $limit = floor($max_allowed_packet / 1024 / 2);
- $blob = str_repeat($tmp, $limit);
-
- $limit = $max_allowed_packet - strlen($blob) + 1;
- $blob .= str_repeat('b', $limit);
-
- assert(strlen($blob) > $max_allowed_packet);
-
- if (false !== ($tmp = mysqli_stmt_send_long_data($stmt, 1, $blob)))
- printf("[009] Expecting boolean/false, got %s/%s. [%d] %s\n",
- gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
-
- $id = 1;
- if (false !== ($tmp = mysqli_stmt_execute($stmt)))
- printf("[010] Expecting boolean/false, got %s/%s, [%d] %s\n",
- gettype($tmp), $tmp, mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt));
-
- mysqli_stmt_close($stmt);
- mysqli_close($link);
-
- print "done!";
-?>
---EXPECTF--
-Warning: mysqli_stmt_send_long_data(): Skipped %d bytes. Last command STMT_SEND_LONG_DATA
hasn't consumed all the output from the server in %s on line %d
-
-Warning: mysqli_stmt_send_long_data(): There was an error while sending long data.
Probably max_allowed_packet_size is smaller than the data. You have to increase it or
send smaller chunks of data. Answer was %d bytes long. in %s on line %d
-done!
| Thread |
|---|
| • PHP mysqlnd svn commit: r323 - in trunk/tests/ext/mysqli: . bench/micro_benches | uwendel | 2 Apr |