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