diff --git a/mysql-test/suite/innodb_stress/include/innodb_stress.inc b/mysql-test/suite/innodb_stress/include/innodb_stress.inc index 41bba6c47188..5877e1285daa 100644 --- a/mysql-test/suite/innodb_stress/include/innodb_stress.inc +++ b/mysql-test/suite/innodb_stress/include/innodb_stress.inc @@ -39,7 +39,7 @@ if ($do_checksum) { # populate the table and store its checksum before any load. let $exec = -$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after +/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after $num_records 0 0 $user $master_host $MASTER_MYPORT $table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 0 0; exec $exec >> $MYSQL_TMP_DIR/load_generator/errors.log; @@ -68,14 +68,14 @@ while ($num_crashes) if ($use_blob) { let $exec = -$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after +/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after $num_records $num_workers $num_transactions $user $master_host $MASTER_MYPORT $table 1 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks; } if (!$use_blob) { let $exec = -$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after +/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $pid_file $kill_db_after $num_records $num_workers $num_transactions $user $master_host $MASTER_MYPORT $table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_checks; } @@ -106,7 +106,7 @@ $table 0 $max_rows $MYSQL_TMP_DIR/load_generator 0 $checksum $secondary_index_ch --echo applying fake updates to the slave let $slave_pid_file = `SELECT @@pid_file`; let $slave_exec = -$PYTHON $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $slave_pid_file $kill_db_after +/usr/bin/python3 $MYSQL_TEST_DIR/suite/innodb_stress/t/load_generator.py $slave_pid_file $kill_db_after 0 $num_workers $num_transactions $user $master_host $SLAVE_MYPORT $table 0 $max_rows $MYSQL_TMP_DIR/load_generator_slave 1 $checksum $secondary_index_checks; exec $slave_exec >> $MYSQL_TMP_DIR/load_generator/errors.log; diff --git a/mysql-test/suite/innodb_stress/t/load_generator.py b/mysql-test/suite/innodb_stress/t/load_generator.py index c917e26aa3a7..dcff29a3a52c 100644 --- a/mysql-test/suite/innodb_stress/t/load_generator.py +++ b/mysql-test/suite/innodb_stress/t/load_generator.py @@ -97,6 +97,7 @@ def populate_table(con, num_records_before, do_blob, log): for i in range(start_id, num_records_before): msg = get_msg(do_blob, i) + # print("length is %d, complen is %d" % (len(msg), len(zlib.compress(msg, 6))), file=log) stmt = """ INSERT INTO t1(id,msg_prefix,msg,msg_length,msg_checksum) VALUES (%d,'%s','%s',%d,'%s') """ % (i+1, msg[0:255], msg, len(msg), sha1(msg)) @@ -223,6 +224,8 @@ def validate_msg(self, msg_prefix, msg, msg_length, msg_checksum, idx): prefix_match = msg_prefix == msg[0:255] checksum = sha1(msg) + if type(msg_checksum) == bytes: + msg_checksum = msg_checksum.decode('ascii') checksum_match = checksum == msg_checksum len_match = len(msg) == msg_length @@ -363,6 +366,7 @@ def runme(self): except mysql.connector.Error as e: if e.args[0] in [2006, 2013, 2055]: # server is killed print("mysqld down, transaction %d" % self.xid) + print("mysqld down, transaction %d" % self.xid, file=self.log) return elif e.args[0] in [1213, 1205]: # deadlock or lock wait timeout, ignore return @@ -403,7 +407,7 @@ def runme(self): server_pid = int(open(pid_file).read()) log = open('%s/main.log' % LG_TMP_DIR, 'a') -# print "kill_db_after = ",kill_db_after," num_records_before = ", \ +# print( "kill_db_after = ",kill_db_after," num_records_before = ", \) #num_records_before, " num_workers= ",num_workers, "num_xactions_per_worker =",\ #num_xactions_per_worker, "user = ",user, "host =", host,"port = ",port,\ #" db = ", db, " server_pid = ", server_pid diff --git a/mysql-test/t/admission_control_multi_query.py b/mysql-test/t/admission_control_multi_query.py index 87a5f67c2659..9d052b1e0016 100644 --- a/mysql-test/t/admission_control_multi_query.py +++ b/mysql-test/t/admission_control_multi_query.py @@ -1,6 +1,7 @@ import time import sys import MySQLdb +from MySQLdb.constants import * import argparse import random import threading diff --git a/mysql-test/t/admission_control_multi_query.test b/mysql-test/t/admission_control_multi_query.test index c23a4ae5dd6f..3bc911ddf420 100644 --- a/mysql-test/t/admission_control_multi_query.test +++ b/mysql-test/t/admission_control_multi_query.test @@ -8,7 +8,7 @@ grant all on test.* to test_user@localhost; use test_db; create table t1 (a int primary key, b int) engine=InnoDB; -let $exec = python $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db'; +let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db'; exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output; drop database test_db; diff --git a/mysql-test/t/admission_control_multi_query_weighted.test b/mysql-test/t/admission_control_multi_query_weighted.test index ca98545406bd..1d97f0e8ce20 100644 --- a/mysql-test/t/admission_control_multi_query_weighted.test +++ b/mysql-test/t/admission_control_multi_query_weighted.test @@ -8,7 +8,7 @@ grant all on test.* to test_user@localhost; use test_db; create table t1 (a int primary key, b int) engine=InnoDB; -let $exec = python $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues; +let $exec = /usr/bin/python3 $MYSQL_TEST_DIR/t/admission_control_multi_query.py --user='test_user' --host=127.0.0.1 --port=$MASTER_MYPORT --database='test_db' --weighted-queues; exec $exec > $MYSQLTEST_VARDIR/tmp/admission_control_multi_query.output; drop database test_db; diff --git a/mysql-test/t/slocket_listen.py b/mysql-test/t/slocket_listen.py index 162dcd0ebb6d..1acf85b39cc4 100755 --- a/mysql-test/t/slocket_listen.py +++ b/mysql-test/t/slocket_listen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python3 from socket import socket, AF_UNIX, SOCK_DGRAM from select import select from os import unlink, getcwd, stat