Commit 05aba79e authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-4447 MariaDB sources should have unix-style line endings everywhere

parent 98c06591
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Add executable plus some additional MySQL specific stuff
# Usage (same as for standard CMake's ADD_EXECUTABLE)
#
# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
#
# MySQL specifics:
# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
# On Windows :
# - add version resource
# - instruct CPack to do autenticode signing if SIGNCODE is set
INCLUDE(cmake_parse_arguments)
FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
MYSQL_PARSE_ARGUMENTS(ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
)
LIST(GET ARG_DEFAULT_ARGS 0 target)
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
IF(NOT ARG_DESTINATION)
SET(ARG_DESTINATION ${INSTALL_BINDIR})
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# Add executable plus some additional MySQL specific stuff
# Usage (same as for standard CMake's ADD_EXECUTABLE)
#
# MYSQL_ADD_EXECUTABLE(target source1...sourceN)
#
# MySQL specifics:
# - instruct CPack to install executable under ${CMAKE_INSTALL_PREFIX}/bin directory
# On Windows :
# - add version resource
# - instruct CPack to do autenticode signing if SIGNCODE is set
INCLUDE(cmake_parse_arguments)
FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
MYSQL_PARSE_ARGUMENTS(ARG
"WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
)
LIST(GET ARG_DEFAULT_ARGS 0 target)
LIST(REMOVE_AT ARG_DEFAULT_ARGS 0)
SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)
ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
IF(NOT ARG_DESTINATION)
SET(ARG_DESTINATION ${INSTALL_BINDIR})
ENDIF()
IF(ARG_COMPONENT)
SET(COMP COMPONENT ${ARG_COMPONENT})
......@@ -50,7 +50,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
ELSE()
SET(COMP COMPONENT Client)
ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
ENDIF()
ENDIF()
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
ENDIF()
ENDFUNCTION()
// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
FILETYPE @FILETYPE@
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
// Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; version 2 of the License.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
PRODUCTVERSION @MAJOR_VERSION@,@MINOR_VERSION@,@PATCH_VERSION@,@TINY_VERSION@
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0
FILEOS VOS__WINDOWS32
FILETYPE @FILETYPE@
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "FileVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
VALUE "ProductVersion", "@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH_VERSION@.@TINY_VERSION@\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1252
END
END
# Italian (it) translation of debconf templates for mysql-dfsg-5.1
# Copyright (C) 2009 Software in the Public Interest
# This file is distributed under the same license as the mysql-dfsg-5.1 package.
# Luca Monducci <luca.mo@tiscali.it>, 2006 - 2009.
#
# Italian (it) translation of debconf templates for mysql-dfsg-5.1
# Copyright (C) 2009 Software in the Public Interest
# This file is distributed under the same license as the mysql-dfsg-5.1 package.
# Luca Monducci <luca.mo@tiscali.it>, 2006 - 2009.
#
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.1 5.1.37 italian debconf templates\n"
......
# Translation of mysql-dfsg-5.1 debconf template to Swedish
# Copyright (C) 2009 Martin Bagge <brother@bsnet.se>
# This file is distributed under the same license as the mysql-dfsg-5.1 package.
#
# Andreas Henriksson <andreas@fatal.se>, 2007
# Martin Bagge <brother@bsnet.se>, 2009
# Translation of mysql-dfsg-5.1 debconf template to Swedish
# Copyright (C) 2009 Martin Bagge <brother@bsnet.se>
# This file is distributed under the same license as the mysql-dfsg-5.1 package.
#
# Andreas Henriksson <andreas@fatal.se>, 2007
# Martin Bagge <brother@bsnet.se>, 2009
msgid ""
msgstr ""
"Project-Id-Version: mysql-dfsg-5.1 5.0.21-3\n"
......
......@@ -45,8 +45,8 @@ INSERT INTO t3 VALUES (1),(2);
INSERT INTO test1.t1 VALUES (3,3);
USE test1;
LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE t1
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';
LOAD DATA INFILE '../../std_data/loaddata7.dat' INTO TABLE t1
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';
DELETE FROM test3.t3 WHERE a=1;
flush logs;
......
--lower-case-table-names=2
--lower-case-table-names=2
This source diff could not be displayed because it is too large. You can view the blob instead.
# Test case for MDEV-246, lp:992983
# Check that ordinary connect/disconnect does not increase aborted_clients
# status variable, but KILL connection does
-- source include/not_embedded.inc
-- source include/count_sessions.inc
FLUSH STATUS;
# Connect/Disconnect look that aborted_clients stays 0
connect (con1,localhost,root,,);
disconnect con1;
connection default;
-- source include/wait_until_count_sessions.inc
# Check that there is 0 aborted clients so far
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
# Kill a connection, check that aborted_clients is incremented
connect(con2,localhost,root,,);
--disable_reconnect
--error ER_CONNECTION_KILLED
KILL CONNECTION_ID();
disconnect con2;
connection default;
-- source include/wait_until_count_sessions.inc
# aborted clients must be 1 now
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
FLUSH STATUS;
# Test case for MDEV-246, lp:992983
# Check that ordinary connect/disconnect does not increase aborted_clients
# status variable, but KILL connection does
-- source include/not_embedded.inc
-- source include/count_sessions.inc
FLUSH STATUS;
# Connect/Disconnect look that aborted_clients stays 0
connect (con1,localhost,root,,);
disconnect con1;
connection default;
-- source include/wait_until_count_sessions.inc
# Check that there is 0 aborted clients so far
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
# Kill a connection, check that aborted_clients is incremented
connect(con2,localhost,root,,);
--disable_reconnect
--error ER_CONNECTION_KILLED
KILL CONNECTION_ID();
disconnect con2;
connection default;
-- source include/wait_until_count_sessions.inc
# aborted clients must be 1 now
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
FLUSH STATUS;
--source include/have_plugin_auth.inc
--source include/not_embedded.inc
--source include/master-slave.inc
#
# Check that replication slave can connect to master using an account
# which authenticates with an external authentication plugin (bug#12897501).
#
# First stop the slave to guarantee that nothing is replicated.
#
--connection slave
--echo [connection slave]
--source include/stop_slave.inc
#
# Create an replication account on the master.
#
--connection master
--echo [connection master]
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
#
# Now go to slave and change the replication user.
#
--connection slave
--echo [connection slave]
--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
CHANGE MASTER TO
MASTER_USER= 'plug_user',
MASTER_PASSWORD= 'plug_user';
#
# Start slave with new replication account - this should trigger connection
# to the master server.
#
--source include/start_slave.inc
# Replicate all statements executed on master, in this case,
# (creation of the plug_user account).
#
--connection master
--sync_slave_with_master
--echo # Slave in-sync with master now.
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
#
# Now we can stop the slave and clean up.
#
# Note: it is important that slave is stopped at this
# moment - otherwise master's cleanup statements
# would be replicated on slave!
#
--echo # Cleanup (on slave).
--source include/stop_slave.inc
eval CHANGE MASTER TO MASTER_USER='$master_user';
DROP USER 'plug_user';
--echo # Cleanup (on master).
--connection master
DROP USER 'plug_user';
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
--source include/have_plugin_auth.inc
--source include/not_embedded.inc
--source include/master-slave.inc
#
# Check that replication slave can connect to master using an account
# which authenticates with an external authentication plugin (bug#12897501).
#
# First stop the slave to guarantee that nothing is replicated.
#
--connection slave
--echo [connection slave]
--source include/stop_slave.inc
#
# Create an replication account on the master.
#
--connection master
--echo [connection master]
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
#
# Now go to slave and change the replication user.
#
--connection slave
--echo [connection slave]
--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
CHANGE MASTER TO
MASTER_USER= 'plug_user',
MASTER_PASSWORD= 'plug_user';
#
# Start slave with new replication account - this should trigger connection
# to the master server.
#
--source include/start_slave.inc
# Replicate all statements executed on master, in this case,
# (creation of the plug_user account).
#
--connection master
--sync_slave_with_master
--echo # Slave in-sync with master now.
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
#
# Now we can stop the slave and clean up.
#
# Note: it is important that slave is stopped at this
# moment - otherwise master's cleanup statements
# would be replicated on slave!
#
--echo # Cleanup (on slave).
--source include/stop_slave.inc
eval CHANGE MASTER TO MASTER_USER='$master_user';
DROP USER 'plug_user';
--echo # Cleanup (on master).
--connection master
DROP USER 'plug_user';
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc
......@@ -49,9 +49,9 @@ select grp,group_concat(c order by grp desc) from t1 group by grp order by grp;
# Test transfer to real values
select grp, group_concat(a separator "")+0 from t1 group by grp;
select grp, group_concat(a separator "")+0.0 from t1 group by grp;
select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
select grp, group_concat(a separator "")+0 from t1 group by grp;
select grp, group_concat(a separator "")+0.0 from t1 group by grp;
select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
drop table t1;
# Test NULL values
......
--lower-case-table-names=2
--lower-case-table-names=2
--source include/have_case_insensitive_file_system.inc
--source include/have_innodb.inc
--echo #
--echo # Bug#46941 crash with lower_case_table_names=2 and
--echo # foreign data dictionary confusion
--echo #
CREATE DATABASE XY;
USE XY;
#
# Logs are disabled, since the number of creates tables
# and subsequent select statements may vary between
# versions
#
--disable_query_log
--disable_result_log
let $tcs = `SELECT @@table_open_cache + 1`;
let $i = $tcs;
while ($i)
{
eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
primary key(a, b), unique(b)) ENGINE=InnoDB;
dec $i;
}
eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b),
ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
let $i = $tcs;
while ($i)
{
eval SELECT * FROM XY.T_$i LIMIT 1;
dec $i;
}
DROP DATABASE XY;
CREATE DATABASE XY;
USE XY;
eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
#
# The bug causes this SELECT to err
eval SELECT * FROM XY.T_$tcs LIMIT 1;
--enable_query_log
--enable_result_log
DROP DATABASE XY;
USE TEST;
--echo #
--echo # Bug55222 Mysqldump table names case bug in REFERENCES clause
--echo # InnoDB did not handle lower_case_table_names=2 for
--echo # foreign_table_names and referenced_table_names.
--echo #
SHOW VARIABLES LIKE 'lower_case_table_names';
--disable_warnings
DROP TABLE IF EXISTS `Table2`;
DROP TABLE IF EXISTS `Table1`;
--disable_warnings
CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
query_vertical SHOW CREATE TABLE `Table2`;
query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
DROP TABLE `Table2`;
DROP TABLE `Table1`;
--disable_warnings
DROP TABLE IF EXISTS Product_Order;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Customer;
--enable_warnings
CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
Product_Category INT NOT NULL,
Product_Id INT NOT NULL,
Customer_Id INT NOT NULL,
PRIMARY KEY(No),
INDEX (Product_Category, Product_Id),
FOREIGN KEY (Product_Category, Product_Id)
REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (Customer_Id),
FOREIGN KEY (Customer_Id)
REFERENCES Customer(Id)
) ENGINE=INNODB;
query_vertical SHOW CREATE TABLE Product_Order;
query_vertical SHOW CREATE TABLE Product;
query_vertical SHOW CREATE TABLE Customer;
query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
DROP TABLE Product_Order;
DROP TABLE Product;
DROP TABLE Customer;
--source include/have_case_insensitive_file_system.inc
--source include/have_innodb.inc
--echo #
--echo # Bug#46941 crash with lower_case_table_names=2 and
--echo # foreign data dictionary confusion
--echo #
CREATE DATABASE XY;
USE XY;
#
# Logs are disabled, since the number of creates tables
# and subsequent select statements may vary between
# versions
#
--disable_query_log
--disable_result_log
let $tcs = `SELECT @@table_open_cache + 1`;
let $i = $tcs;
while ($i)
{
eval CREATE TABLE XY.T_$i (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
primary key(a, b), unique(b)) ENGINE=InnoDB;
dec $i;
}
eval ALTER TABLE XY.T_$tcs ADD INDEX I1 (c, b),
ADD CONSTRAINT C1 FOREIGN KEY (c, b) REFERENCES XY.T_1 (a, b);
eval ALTER TABLE XY.T_$tcs ADD INDEX I2 (b),
ADD CONSTRAINT C2 FOREIGN KEY (b) REFERENCES XY.T_1(a);
let $i = $tcs;
while ($i)
{
eval SELECT * FROM XY.T_$i LIMIT 1;
dec $i;
}
DROP DATABASE XY;
CREATE DATABASE XY;
USE XY;
eval CREATE TABLE XY.T_$tcs (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
PRIMARY KEY(a, b), UNIQUE(b)) ENGINE=InnoDB;
#
# The bug causes this SELECT to err
eval SELECT * FROM XY.T_$tcs LIMIT 1;
--enable_query_log
--enable_result_log
DROP DATABASE XY;
USE TEST;
--echo #
--echo # Bug55222 Mysqldump table names case bug in REFERENCES clause
--echo # InnoDB did not handle lower_case_table_names=2 for
--echo # foreign_table_names and referenced_table_names.
--echo #
SHOW VARIABLES LIKE 'lower_case_table_names';
--disable_warnings
DROP TABLE IF EXISTS `Table2`;
DROP TABLE IF EXISTS `Table1`;
--disable_warnings
CREATE TABLE `Table1`(c1 INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE `Table2`(c1 INT PRIMARY KEY, c2 INT) ENGINE=InnoDB;
ALTER TABLE `Table2` ADD CONSTRAINT fk1 FOREIGN KEY(c2) REFERENCES `Table1`(c1);
query_vertical SHOW CREATE TABLE `Table2`;
query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
DROP TABLE `Table2`;
DROP TABLE `Table1`;
--disable_warnings
DROP TABLE IF EXISTS Product_Order;
DROP TABLE IF EXISTS Product;
DROP TABLE IF EXISTS Customer;
--enable_warnings
CREATE TABLE Product (Category INT NOT NULL, Id INT NOT NULL,
Price DECIMAL, PRIMARY KEY(Category, Id)) ENGINE=InnoDB;
CREATE TABLE Customer (Id INT NOT NULL, PRIMARY KEY (Id)) ENGINE=InnoDB;
CREATE TABLE Product_Order (No INT NOT NULL AUTO_INCREMENT,
Product_Category INT NOT NULL,
Product_Id INT NOT NULL,
Customer_Id INT NOT NULL,
PRIMARY KEY(No),
INDEX (Product_Category, Product_Id),
FOREIGN KEY (Product_Category, Product_Id)
REFERENCES Product(Category, Id) ON UPDATE CASCADE ON DELETE RESTRICT,
INDEX (Customer_Id),
FOREIGN KEY (Customer_Id)
REFERENCES Customer(Id)
) ENGINE=INNODB;
query_vertical SHOW CREATE TABLE Product_Order;
query_vertical SHOW CREATE TABLE Product;
query_vertical SHOW CREATE TABLE Customer;
query_vertical SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_SCHEMA='test';
DROP TABLE Product_Order;
DROP TABLE Product;
DROP TABLE Customer;
......@@ -134,7 +134,7 @@ err:
#elif defined(_WIN32)
#include <winsock2.h>
#include <iphlpapi.h>
#pragma comment(lib, "iphlpapi.lib")
#pragma comment(lib, "iphlpapi.lib")
#define ETHER_ADDR_LEN 6
......
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
use Cwd;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
$pwd = cwd(); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
$n = 0;
for ($i = 0; $i < 1; $i++) {
print "Dropping table innotest1\n";
$dbh->do("drop table innotest1");
print "Creating table innotest1\n";
$dbh->do(
"create table innotest1 (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), E TIMESTAMP, F TIMESTAMP, G DATETIME, PRIMARY KEY (A, D), INDEX
(B, C), INDEX (C), INDEX (D), INDEX(E), INDEX(G)) TYPE = INNODB")
|| die $dbh->errstr;
for ($j = 2; $j < $opt_loop_count - 10; $j = $j + 2) {
if ($j % 10 == 0) {
$dbh->do(
"insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NULL, NULL)");
} else {
$dbh->do(
"insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NOW(), NOW())");
}
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 7]."' where A = ".$random[$j + 5]);
$dbh->do("update innotest1 SET D = D + 1 where A =".($j / 2 - 500));
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 1]."' where A =".($j / 2 - 505));
$dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 97)) {
fetch_all_rows($dbh, "select c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select b, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select d, b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
$dbh->do("rollback");
}
for ($k = 1; $k < 10; $k++) {
$n += fetch_all_rows($dbh,
"SELECT a, d from innotest1 where a = ".(($k * 1764767) % $j));
$n += fetch_all_rows($dbh,
"SELECT * from innotest1 where a = ".(($k * 187567) % $j));
}
if (0 == ($j % 1000)) {
print "round $j, $n rows fetched\n";
}
if (0 == ($j % 20000)) {
print "Checking table innotest1...\n";
$dbh->do("check table innotest1");
print "Table checked.\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
$n = 0;
for ($i = 0; $i < 1; $i++) {
print "Dropping table innotest1\n";
$dbh->do("drop table innotest1");
print "Creating table innotest1\n";
$dbh->do(
"create table innotest1 (A INT NOT NULL AUTO_INCREMENT, D INT NOT NULL, B VARCHAR(200) NOT NULL, C VARCHAR(175), E TIMESTAMP, F TIMESTAMP, G DATETIME, PRIMARY KEY (A, D), INDEX
(B, C), INDEX (C), INDEX (D), INDEX(E), INDEX(G)) TYPE = INNODB")
|| die $dbh->errstr;
for ($j = 2; $j < $opt_loop_count - 10; $j = $j + 2) {
if ($j % 10 == 0) {
$dbh->do(
"insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NULL, NULL)");
} else {
$dbh->do(
"insert into innotest1 (D, B, C, F, G) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."', NOW(), NOW())");
}
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 7]."' where A = ".$random[$j + 5]);
$dbh->do("update innotest1 SET D = D + 1 where A =".($j / 2 - 500));
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 1]."' where A =".($j / 2 - 505));
$dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 97)) {
fetch_all_rows($dbh, "select c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select b, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select a, b, c, e, f, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
fetch_all_rows($dbh, "select d, b, c, g from innotest1 where b = '".$rnd_str[$j - 677]."'");
$dbh->do("rollback");
}
for ($k = 1; $k < 10; $k++) {
$n += fetch_all_rows($dbh,
"SELECT a, d from innotest1 where a = ".(($k * 1764767) % $j));
$n += fetch_all_rows($dbh,
"SELECT * from innotest1 where a = ".(($k * 187567) % $j));
}
if (0 == ($j % 1000)) {
print "round $j, $n rows fetched\n";
}
if (0 == ($j % 20000)) {
print "Checking table innotest1...\n";
$dbh->do("check table innotest1");
print "Table checked.\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
use Cwd;
use DBI;
use Benchmark;
$opt_loop_count = 200000;
use DBI;
use Benchmark;
$opt_loop_count = 200000;
$pwd = cwd(); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1a: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 1; $i++) {
print "loop $i\n";
for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
$dbh->do(
"insert into innotest1 (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')");
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 2]."' where A = ".$random[$j + 5]);
$dbh->do("update innotest1 SET D = D + 1 where A =".(($j - 1) / 2 - 777));
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 8]."' where A =".(($j - 1) / 2 - 770));
$dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 37)) {
$dbh->do("commit");
}
if (0 == ($j % 533)) {
$dbh->do("rollback");
}
if (0 == ($j % 537)) {
print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
print "\n";
}
if (0 == (($j - 1) % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1a: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 1; $i++) {
print "loop $i\n";
for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
$dbh->do(
"insert into innotest1 (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')");
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 2]."' where A = ".$random[$j + 5]);
$dbh->do("update innotest1 SET D = D + 1 where A =".(($j - 1) / 2 - 777));
$dbh->do("update innotest1 set B = '".$rnd_str[$j + 8]."' where A =".(($j - 1) / 2 - 770));
$dbh->do("delete from innotest1 where A = ".$random[$random[$j]]);
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 37)) {
$dbh->do("commit");
}
if (0 == ($j % 533)) {
$dbh->do("rollback");
}
if (0 == ($j % 537)) {
print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
print "\n";
}
if (0 == (($j - 1) % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/InnoDB combined database
# (c) 2002 Innobase Oy & MySQL AB
#
############################################################################
use Cwd;
use DBI;
use Benchmark;
$opt_loop_count = 200000;
use DBI;
use Benchmark;
$opt_loop_count = 200000;
$pwd = cwd(); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1b: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 5; $i++) {
print "loop $i\n";
for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 37)) {
$dbh->do("commit");
}
if (0 == ($j % 533)) {
$dbh->do("rollback");
}
if (0 == ($j % 537)) {
print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
print "\n";
}
if (0 == (($j - 1) % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest1b: MySQL/InnoDB stress test in Perl\n";
print "-------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest1, innotest1a, and innotest1b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on table innotest1 in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest1 > out1\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "kjgclgrtfuylfluyfyufyulfulfyyulofuyolfyufyufuyfyufyufyufyufyyufujhfghd";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kh";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 5; $i++) {
print "loop $i\n";
for ($j = 1; $j < $opt_loop_count - 10; $j = $j + 2) {
fetch_all_rows($dbh, "select b, c from innotest1 where a > ".$random[$j]." and a < ".($random[$j] + 7));
if (0 == ($j % 37)) {
$dbh->do("commit");
}
if (0 == ($j % 533)) {
$dbh->do("rollback");
}
if (0 == ($j % 537)) {
print fetch_all_rows($dbh, "select c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b from innotest1 where b = '".$rnd_str[$j - 688]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where c = '".$rnd_str[$j - 67]."'");
print fetch_all_rows($dbh, "select b, c from innotest1 where b = '".$rnd_str[$j - 622]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select a, b, c from innotest1 where b = '".$rnd_str[$j - 644]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where c = '".$rnd_str[$j - 68]."'");
print fetch_all_rows($dbh, "select d, b, c from innotest1 where b = '".$rnd_str[$j - 677]."'");
print "\n";
}
if (0 == (($j - 1) % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
This diff is collapsed.
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/Innobase combined database
# (c) 2000 Innobase Oy & MySQL AB
#
############################################################################
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/Innobase combined database
# (c) 2000 Innobase Oy & MySQL AB
#
############################################################################
use Cwd;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
$pwd = cwd(); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest2a: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
print "------------------------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks with foreign keys with\n";
print "the ON DELETE ... clause. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest2 > out2\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "khD";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "kHd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 5; $i++) {
print "loop $i\n";
for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 1) {
$dbh->do("update innotest2a set B = '".$rnd_str[$j + 1]."' where A = ".$random[$j + 5])
|| print $dbh->errstr;
$dbh->do("delete from innotest2a where A = ".$random[$random[$j]])
|| print $dbh->errstr;
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 39)) {
$dbh->do("rollback");
}
if (0 == ($j % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest2a: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
print "------------------------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks with foreign keys with\n";
print "the ON DELETE ... clause. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest2 > out2\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 63857) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "khD";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "kHd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
}}}
for ($j = 0; $j < (($i * 764877) % 20); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect()
|| die $dbh->errstr;
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 5; $i++) {
print "loop $i\n";
for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 1) {
$dbh->do("update innotest2a set B = '".$rnd_str[$j + 1]."' where A = ".$random[$j + 5])
|| print $dbh->errstr;
$dbh->do("delete from innotest2a where A = ".$random[$random[$j]])
|| print $dbh->errstr;
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 39)) {
$dbh->do("rollback");
}
if (0 == ($j % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/Innobase combined database
# (c) 2000 Innobase Oy & MySQL AB
#
############################################################################
#!/usr/bin/perl
############################################################################
# Stress test for MySQL/Innobase combined database
# (c) 2000 Innobase Oy & MySQL AB
#
############################################################################
use Cwd;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
use DBI;
use Benchmark;
$opt_loop_count = 100000;
$pwd = cwd(); $pwd = "." if ($pwd eq '');
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest2b: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
print "------------------------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks with foreign keys with\n";
print "the ON DELETE ... clause. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest2 > out2\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 98641) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "khD";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kHd";
}}}
for ($j = 0; $j < (($i * 764877) % 10); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect();
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 1; $i++) {
print "loop $i\n";
for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 2) {
$dbh->do(
"insert into innotest2b (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do(
"insert into innotest2a (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do(
"insert into innotest2c (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do("delete from innotest2b where A = ".$random[$random[$j]])
|| print $dbh->errstr;
$dbh->do("update innotest2b set A = A + 1 where A = ".$random[$j])
|| print $dbh->errstr;
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 39)) {
$dbh->do("rollback");
}
if (0 == ($j % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
require "$pwd/bench-init.pl" || die "Can't read Configuration file: $!\n";
print "Innotest2b: MySQL/InnoDB stress test in Perl for FOREIGN keys\n";
print "------------------------------------------------------------\n";
print "This is a randomized stress test for concurrent inserts,\n";
print "updates, deletes, commits and rollbacks with foreign keys with\n";
print "the ON DELETE ... clause. The test will generate\n";
print "also a lot of deadlocks, duplicate key errors, and other SQL errors.\n";
print "\n";
print "You should run innotest2, innotest2a, and innotest2b concurrently.\n";
print "The thing to watch is that the server does not crash or does not\n";
print "print to the .err log anything. Currently, due to a buglet in MySQL,\n";
print "warnings about MySQL lock reservations can appear in the .err log.\n";
print "The test will run very long, even several hours. You can kill\n";
print "the perl processes running this test at any time and do CHECK\n";
print "TABLE on tables innotest2a, b, c, d in the 'test' database.\n";
print "\n";
print "Some of these stress tests will print a lot of SQL errors\n";
print "to the standard output. That is not to be worried about.\n";
print "You can direct the output to a file like this:\n";
print "perl innotest2 > out2\n\n";
print "Generating random keys\n";
$random[$opt_loop_count] = 0;
$rnd_str[$opt_loop_count] = "a";
for ($i = 0; $i < $opt_loop_count; $i++) {
$random[$i] = ($i * 98641) % $opt_loop_count;
if (0 == ($random[$i] % 3)) {
$rnd_str[$i] = "khD";
} else { if (1 == ($random[$i] % 3)) {
$rnd_str[$i] = "khd";
} else { if (2 == ($random[$i] % 3)) {
$rnd_str[$i] = "kHd";
}}}
for ($j = 0; $j < (($i * 764877) % 10); $j++) {
$rnd_str[$i] = $rnd_str[$i]."k";
}
}
####
#### Connect
####
$dbh = $server->connect();
$dbh->do("set autocommit = 0");
for ($i = 0; $i < 1; $i++) {
print "loop $i\n";
for ($j = 0; $j < $opt_loop_count - 10; $j = $j + 2) {
$dbh->do(
"insert into innotest2b (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do(
"insert into innotest2a (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do(
"insert into innotest2c (D, B, C) values (5, '".$rnd_str[$j]."' ,'".$rnd_str[$j]."')")
|| print $dbh->errstr;
$dbh->do("delete from innotest2b where A = ".$random[$random[$j]])
|| print $dbh->errstr;
$dbh->do("update innotest2b set A = A + 1 where A = ".$random[$j])
|| print $dbh->errstr;
if (0 == ($j % 10)) {
$dbh->do("commit");
}
if (0 == ($j % 39)) {
$dbh->do("rollback");
}
if (0 == ($j % 1000)) {
print "round $j\n";
}
}
$dbh->do("commit");
}
$dbh->disconnect; # close connection
This diff is collapsed.
#ifndef MESSAGE_INCLUDED
#define MESSAGE_INCLUDED
/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
To change or add messages mysqld writes to the Windows error log, run
mc.exe message.mc
and checkin generated messages.h, messages.rc and msg000001.bin under the
source control.
mc.exe can be installed with Windows SDK, some Visual Studio distributions
do not include it.
*/
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Define the facility codes
//
//
// Define the severity codes
//
//
// MessageId: MSG_DEFAULT
//
// MessageText:
//
// %1For more information, see Help and Support Center at http://www.mysql.com.
//
//
//
#define MSG_DEFAULT 0xC0000064L
#endif /* MESSAGE_INCLUDED */
#ifndef MESSAGE_INCLUDED
#define MESSAGE_INCLUDED
/* Copyright (c) 2008, 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
To change or add messages mysqld writes to the Windows error log, run
mc.exe message.mc
and checkin generated messages.h, messages.rc and msg000001.bin under the
source control.
mc.exe can be installed with Windows SDK, some Visual Studio distributions
do not include it.
*/
//
// Values are 32 bit values layed out as follows:
//
// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
// +---+-+-+-----------------------+-------------------------------+
// |Sev|C|R| Facility | Code |
// +---+-+-+-----------------------+-------------------------------+
//
// where
//
// Sev - is the severity code
//
// 00 - Success
// 01 - Informational
// 10 - Warning
// 11 - Error
//
// C - is the Customer code flag
//
// R - is a reserved bit
//
// Facility - is the facility code
//
// Code - is the facility's status code
//
//
// Define the facility codes
//
//
// Define the severity codes
//
//
// MessageId: MSG_DEFAULT
//
// MessageText:
//
// %1For more information, see Help and Support Center at http://www.mysql.com.
//
//
//
#define MSG_DEFAULT 0xC0000064L
#endif /* MESSAGE_INCLUDED */
......@@ -5762,8 +5762,8 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
/* Set MYSQL_PLUGIN_DIR in case master asks for an external authentication plugin */
if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
/* we disallow empty users */
if (mi->user == NULL || mi->user[0] == 0)
......
SET(FEDERATEDX_PLUGIN_STATIC "federatedx")
SET(FEDERATEDX_PLUGIN_DYNAMIC "ha_federatedx")
SET(FEDERATEDX_SOURCES ha_federatedx.cc federatedx_txn.cc federatedx_io.cc federatedx_io_null.cc federatedx_io_mysql.cc)
MYSQL_ADD_PLUGIN(federatedx ${FEDERATEDX_SOURCES} STORAGE_ENGINE)
SET(FEDERATEDX_PLUGIN_STATIC "federatedx")
SET(FEDERATEDX_PLUGIN_DYNAMIC "ha_federatedx")
SET(FEDERATEDX_SOURCES ha_federatedx.cc federatedx_txn.cc federatedx_io.cc federatedx_io_null.cc federatedx_io_mysql.cc)
MYSQL_ADD_PLUGIN(federatedx ${FEDERATEDX_SOURCES} STORAGE_ENGINE)
......@@ -43,7 +43,7 @@ my $error_log_name= "./var/log/master.err";
my @cmd_output;
my $whatever; # garbage data
$ENV{MTR_VERSION} = 1; # MTR2 does not have --start-and-exit
my $base_server_cmd= "perl mysql-test-run.pl --mysqld=--aria-force-start-after-recovery-failures=$force_after --suite=maria maria.maria-recover ";
my $base_server_cmd= "perl mysql-test-run.pl --mysqld=--aria-force-start-after-recovery-failures=$force_after --suite=maria maria.maria-recover ";
if ($^O =~ /^mswin/i)
{
print <<EOF;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment