mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Manual merge from mysql-trunk.
Conflicts: - mysql-test/r/partition.result - mysql-test/r/variables_debug.result - mysql-test/t/partition.test - mysql-test/t/variables_debug.test
This commit is contained in:
@@ -18,6 +18,7 @@ INSTALL(
|
||||
DESTINATION ${INSTALL_MYSQLTESTDIR}
|
||||
PATTERN "var/" EXCLUDE
|
||||
PATTERN "lib/My/SafeProcess" EXCLUDE
|
||||
PATTERN "lib/t*" EXCLUDE
|
||||
PATTERN "CPack" EXCLUDE
|
||||
PATTERN "CMake*" EXCLUDE
|
||||
PATTERN "mtr.out*" EXCLUDE
|
||||
|
@@ -148,6 +148,3 @@ mtr:
|
||||
mysql-test-run:
|
||||
$(RM) -f mysql-test-run
|
||||
$(LN_S) mysql-test-run.pl mysql-test-run
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@@ -6,6 +6,8 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment
|
||||
funcs_1.charset_collation_1 # depends on compile-time decisions
|
||||
funcs_1.myisam_views @solaris # Bug#50595 2010-03-05 alik funcs_1.myisam_views takes longer time on 6.0 branch than 5.1 branch
|
||||
|
||||
innodb.innodb_information_schema # Bug#48883 2010-05-11 alik Test "innodb_information_schema" takes fewer locks than expected
|
||||
|
||||
main.func_math @freebsd # Bug#43020 2010-05-04 alik main.func_math fails on FreeBSD in PB2
|
||||
main.gis @solaris # Bug#52208 2010-04-26 alik gis fails on some platforms (Solaris, HP-UX, Linux)
|
||||
main.gis-rtree @freebsd # Bug#38965 2010-05-04 alik test cases gis-rtree, type_float, type_newdecimal fail in embedded server
|
||||
|
@@ -457,6 +457,8 @@ select * from t1;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
# Ensure that row_count() value is reset after drop table.
|
||||
select 1;
|
||||
select hex(concat(row_count()));
|
||||
create table t1 as select concat(row_count()) as c1;
|
||||
show create table t1;
|
||||
|
@@ -23,7 +23,7 @@ perl;
|
||||
while (<F>) {
|
||||
next if 1../The following groups are read/;
|
||||
# formatting, skip line consisting entirely of dashes and blanks
|
||||
next if /^[\- ]+$/;
|
||||
next if /^[\- ]+\s?$/;
|
||||
next if /Value \(after reading options\)/; # skip table header
|
||||
next if /^($re1) /;
|
||||
next if /^($re2)-/;
|
||||
|
@@ -23,7 +23,3 @@ my_safe_process_SOURCES = safe_process.cc
|
||||
EXTRA_DIST = safe_kill_win.cc \
|
||||
safe_process_win.cc \
|
||||
CMakeLists.txt
|
||||
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@@ -772,6 +772,9 @@ t1 CREATE TABLE `t1` (
|
||||
`c1` varbinary(31) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
select hex(concat(row_count()));
|
||||
hex(concat(row_count()))
|
||||
2D31
|
||||
|
@@ -854,6 +854,9 @@ t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(31) CHARACTER SET cp1251 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
select hex(concat(row_count()));
|
||||
hex(concat(row_count()))
|
||||
2D31
|
||||
|
@@ -1182,6 +1182,9 @@ t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(31) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
select hex(concat(row_count()));
|
||||
hex(concat(row_count()))
|
||||
2D31
|
||||
|
@@ -2014,6 +2014,9 @@ t1 CREATE TABLE `t1` (
|
||||
`c1` varchar(31) CHARACTER SET ucs2 DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
select 1;
|
||||
1
|
||||
1
|
||||
select hex(concat(row_count()));
|
||||
hex(concat(row_count()))
|
||||
002D0031
|
||||
|
@@ -1,3 +1,122 @@
|
||||
SET @old_general_log= @@global.general_log;
|
||||
ok
|
||||
|
||||
# cat MYSQL_TMP_DIR/test_wl4435.out.log
|
||||
# ------------------------------------
|
||||
|
||||
exec_counter: 0
|
||||
num_fields: 4
|
||||
- 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 1; str: '11'; dbl: 12.340000; dec: '56.7';
|
||||
int: 2; str: '12'; dbl: 56.780000; dec: '90.1';
|
||||
int: 3; str: '13'; dbl: 23.450000; dec: '67.8';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 5
|
||||
num_fields: 5
|
||||
- 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1';
|
||||
int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2';
|
||||
int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 8
|
||||
num_fields: 8
|
||||
- 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3
|
||||
- 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0
|
||||
- 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3
|
||||
- 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4
|
||||
- 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
Data:
|
||||
str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789;
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 0
|
||||
|
||||
exec_counter: 1
|
||||
num_fields: 4
|
||||
- 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 1; str: '11'; dbl: 12.340000; dec: '56.7';
|
||||
int: 2; str: '12'; dbl: 56.780000; dec: '90.1';
|
||||
int: 3; str: '13'; dbl: 23.450000; dec: '67.8';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 5
|
||||
num_fields: 5
|
||||
- 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1';
|
||||
int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2';
|
||||
int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 8
|
||||
num_fields: 8
|
||||
- 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3
|
||||
- 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0
|
||||
- 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3
|
||||
- 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4
|
||||
- 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
Data:
|
||||
str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789;
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 0
|
||||
|
||||
exec_counter: 2
|
||||
num_fields: 4
|
||||
- 0: name: 'a1'/'a1'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'a2'/'a2'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 2: name: 'a3'/'a3'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 3: name: 'a4'/'a4'; table: 't1'/'t1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 1; str: '11'; dbl: 12.340000; dec: '56.7';
|
||||
int: 2; str: '12'; dbl: 56.780000; dec: '90.1';
|
||||
int: 3; str: '13'; dbl: 23.450000; dec: '67.8';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 5
|
||||
num_fields: 5
|
||||
- 0: name: 'b0'/'b0'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 1: name: 'b1'/'b1'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 2: name: 'b2'/'b2'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 3: name: 'b3'/'b3'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 4: name: 'b4'/'b4'; table: 't2'/'t2'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 246; decimals: 1
|
||||
Data:
|
||||
int: 100; int: 10; str: '110'; dbl: 70.700000; dec: '10.1';
|
||||
int: 200; int: 20; str: '120'; dbl: 80.800000; dec: '20.2';
|
||||
int: 300; int: 30; str: '130'; dbl: 90.900000; dec: '30.3';
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 8
|
||||
num_fields: 8
|
||||
- 0: name: 'v_str_1'/'v_str_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 32; max_length: 0; type: 254; decimals: 0
|
||||
- 1: name: 'v_dbl_1'/'v_dbl_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2
|
||||
- 2: name: 'v_dec_1'/'v_dec_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 8; max_length: 0; type: 246; decimals: 3
|
||||
- 3: name: 'v_int_1'/'v_int_1'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
- 4: name: 'v_str_2'/'v_str_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 64; max_length: 0; type: 254; decimals: 0
|
||||
- 5: name: 'v_dbl_2'/'v_dbl_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 5; max_length: 0; type: 5; decimals: 3
|
||||
- 6: name: 'v_dec_2'/'v_dec_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 9; max_length: 0; type: 246; decimals: 4
|
||||
- 7: name: 'v_int_2'/'v_int_2'; table: 'p1'/'p1'; db: 'client_test_db'; catalog: 'def'; length: 11; max_length: 0; type: 3; decimals: 0
|
||||
Data:
|
||||
str: 'test_1'; dbl: 12.340000; dec: '567.891'; int: 2345; str: 'test_2'; dbl: 67.891000; dec: '234.6789'; int: 6789;
|
||||
EOF
|
||||
mysql_stmt_next_result(): 0; field_count: 0
|
||||
# ------------------------------------
|
||||
|
||||
SET @@global.general_log= @old_general_log;
|
||||
|
@@ -2112,6 +2112,26 @@ COUNT(*)
|
||||
DROP TABLE t1;
|
||||
SET SESSION SQL_MODE=DEFAULT;
|
||||
#
|
||||
# Bug#46198: Hang after failed ALTER TABLE on partitioned table.
|
||||
#
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1);
|
||||
LOCK TABLES t1 WRITE, t1 b READ;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t1 DROP PARTITION p1;
|
||||
ERROR HY000: DROP PARTITION can only be used on RANGE/LIST partitions
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1);
|
||||
LOCK TABLES t1 WRITE, t1 b READ;
|
||||
UNLOCK TABLES;
|
||||
ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE);
|
||||
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
|
||||
SELECT * FROM t1;
|
||||
s1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
|
||||
#
|
||||
SET GLOBAL myisam_use_mmap=1;
|
||||
|
@@ -2590,11 +2590,11 @@ row_count()
|
||||
call bug4905()|
|
||||
select row_count()|
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
call bug4905()|
|
||||
select row_count()|
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
select * from t3|
|
||||
s1
|
||||
1
|
||||
|
@@ -10,6 +10,13 @@ set debug= '-P';
|
||||
select @@debug;
|
||||
@@debug
|
||||
T
|
||||
SELECT @@session.debug, @@global.debug;
|
||||
@@session.debug @@global.debug
|
||||
T
|
||||
SET SESSION debug = '';
|
||||
SELECT @@session.debug, @@global.debug;
|
||||
@@session.debug @@global.debug
|
||||
|
||||
#
|
||||
# Bug #52629: memory leak from sys_var_thd_dbug in
|
||||
# binlog.binlog_write_error
|
||||
|
@@ -375,7 +375,7 @@ row_count() after delete
|
||||
2
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
SELECT * FROM temp;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
qwe xyz 1998-03-26 100 uvw 1000
|
||||
|
@@ -376,7 +376,7 @@ row_count() after delete
|
||||
2
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
SELECT * FROM temp;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
qwe xyz 1998-03-26 100 uvw 1000
|
||||
|
@@ -376,7 +376,7 @@ row_count() after delete
|
||||
2
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
SELECT * FROM temp;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
qwe xyz 1998-03-26 100 uvw 1000
|
||||
|
@@ -375,7 +375,7 @@ row_count() after delete
|
||||
2
|
||||
SELECT row_count();
|
||||
row_count()
|
||||
-1
|
||||
0
|
||||
SELECT * FROM temp;
|
||||
f1 f2 f3 f4 f5 f6
|
||||
qwe xyz 1998-03-26 100 uvw 1000
|
||||
|
79
mysql-test/suite/funcs_1/r/row_count_func.result
Normal file
79
mysql-test/suite/funcs_1/r/row_count_func.result
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
# --
|
||||
# -- Test case for Bug#21818.
|
||||
# --
|
||||
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
# -- Check 1.
|
||||
SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt";
|
||||
affected rows: 3
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
3
|
||||
|
||||
# -- Check 2.
|
||||
SELECT a FROM t1 LIMIT 1 INTO @a;
|
||||
affected rows: 1
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
1
|
||||
|
||||
# -- Check 3.
|
||||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
CREATE DATABASE mysqltest1;
|
||||
affected rows: 1
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
1
|
||||
DROP DATABASE mysqltest1;
|
||||
|
||||
# -- Check 4.
|
||||
DELETE FROM t1;
|
||||
LOAD DATA INFILE 'MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a);
|
||||
affected rows: 3
|
||||
info: Records: 3 Deleted: 0 Skipped: 0 Warnings: 0
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
3
|
||||
|
||||
# -- Check 5.
|
||||
ALTER TABLE t1 ADD COLUMN b VARCHAR(255);
|
||||
affected rows: 3
|
||||
info: Records: 3 Duplicates: 0 Warnings: 0
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
3
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# -- Check 6.
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t2 VALUES (ROW_COUNT());
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
3
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
# -- Check 7 (check that SQL errors reset row_count to -1).
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
SELECT f1();
|
||||
ERROR 42000: FUNCTION test.f1 does not exist
|
||||
SELECT ROW_COUNT();
|
||||
ROW_COUNT()
|
||||
-1
|
||||
DROP TABLE t1;
|
||||
|
||||
# -- End of test case for Bug#21818.
|
1
mysql-test/suite/funcs_1/t/row_count_func-master.opt
Normal file
1
mysql-test/suite/funcs_1/t/row_count_func-master.opt
Normal file
@@ -0,0 +1 @@
|
||||
--secure-file-priv=$MYSQL_TMP_DIR
|
115
mysql-test/suite/funcs_1/t/row_count_func.test
Normal file
115
mysql-test/suite/funcs_1/t/row_count_func.test
Normal file
@@ -0,0 +1,115 @@
|
||||
--echo
|
||||
--echo # --
|
||||
--echo # -- Test case for Bug#21818.
|
||||
--echo # --
|
||||
--echo
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
|
||||
--echo
|
||||
--echo # -- Check 1.
|
||||
|
||||
--enable_info
|
||||
--echo SELECT * FROM t1 INTO OUTFILE "MYSQL_TMP_DIR/bug21818.txt";
|
||||
--disable_query_log # to avoid $MYSQL_TMP_DIR in query log
|
||||
--eval SELECT * FROM t1 INTO OUTFILE "$MYSQL_TMP_DIR/bug21818.txt"
|
||||
--enable_query_log
|
||||
--disable_info
|
||||
|
||||
--echo
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
--echo
|
||||
--echo # -- Check 2.
|
||||
|
||||
--enable_info
|
||||
SELECT a FROM t1 LIMIT 1 INTO @a;
|
||||
--disable_info
|
||||
|
||||
--echo
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
--echo
|
||||
--echo # -- Check 3.
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mysqltest1;
|
||||
--enable_warnings
|
||||
|
||||
--enable_info
|
||||
CREATE DATABASE mysqltest1;
|
||||
--disable_info
|
||||
|
||||
--echo
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
DROP DATABASE mysqltest1;
|
||||
|
||||
--echo
|
||||
--echo # -- Check 4.
|
||||
|
||||
DELETE FROM t1;
|
||||
|
||||
--enable_info
|
||||
--echo LOAD DATA INFILE 'MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a);
|
||||
--disable_query_log # to avoid $MYSQL_TMP_DIR in query log
|
||||
--eval LOAD DATA INFILE '$MYSQL_TMP_DIR/bug21818.txt' INTO TABLE t1(a)
|
||||
--enable_query_log
|
||||
--disable_info
|
||||
|
||||
--echo
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
--remove_file $MYSQL_TMP_DIR/bug21818.txt
|
||||
|
||||
--echo
|
||||
--echo # -- Check 5.
|
||||
|
||||
--enable_info
|
||||
ALTER TABLE t1 ADD COLUMN b VARCHAR(255);
|
||||
--disable_info
|
||||
|
||||
--echo
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # -- Check 6.
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t2;
|
||||
--enable_warnings
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
CREATE TABLE t2(a INT);
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
INSERT INTO t2 VALUES (ROW_COUNT());
|
||||
|
||||
SELECT * FROM t2;
|
||||
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
|
||||
--echo
|
||||
--echo # -- Check 7 (check that SQL errors reset row_count to -1).
|
||||
|
||||
CREATE TABLE t1(a INT);
|
||||
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
--error ER_SP_DOES_NOT_EXIST
|
||||
SELECT f1();
|
||||
|
||||
SELECT ROW_COUNT();
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # -- End of test case for Bug#21818.
|
@@ -10,7 +10,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2
|
||||
rpl_row_create_table : Bug#51574 Feb 27 2010 andrei failed different way than earlier with bug#45576
|
||||
rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux
|
||||
rpl_failed_optimize : WL#4284: Can't optimize table used by a pending transaction (there is metadata lock on the table).
|
||||
|
@@ -16,4 +16,11 @@ SET @old_general_log= @@global.general_log;
|
||||
# End of 4.1 tests
|
||||
echo ok;
|
||||
|
||||
--echo
|
||||
--echo # cat MYSQL_TMP_DIR/test_wl4435.out.log
|
||||
--echo # ------------------------------------
|
||||
--cat_file $MYSQL_TMP_DIR/test_wl4435.out.log
|
||||
--echo # ------------------------------------
|
||||
--echo
|
||||
|
||||
SET @@global.general_log= @old_general_log;
|
||||
|
@@ -399,4 +399,12 @@ delimiter ;$$
|
||||
|
||||
drop procedure p_37228;
|
||||
|
||||
#
|
||||
# Bug#27863 (excessive memory usage for many small queries in a multiquery
|
||||
# packet).
|
||||
#
|
||||
|
||||
let $i=`select repeat("set @a=1;", 65535)`;
|
||||
--disable_query_log
|
||||
eval $i;
|
||||
--enable_query_log
|
||||
|
@@ -2119,6 +2119,50 @@ SET SESSION SQL_MODE=DEFAULT;
|
||||
#
|
||||
#DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#46198: Hang after failed ALTER TABLE on partitioned table.
|
||||
--echo #
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
#
|
||||
# Case 1.
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (s1 INT PRIMARY KEY) PARTITION BY HASH(s1);
|
||||
|
||||
LOCK TABLES t1 WRITE, t1 b READ;
|
||||
|
||||
UNLOCK TABLES;
|
||||
|
||||
--error ER_ONLY_ON_RANGE_LIST_PARTITION
|
||||
ALTER TABLE t1 DROP PARTITION p1;
|
||||
|
||||
# The SELECT below used to hang in tdc_wait_for_old_versions().
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Case 2.
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (s1 VARCHAR(5) PRIMARY KEY) PARTITION BY KEY(s1);
|
||||
|
||||
LOCK TABLES t1 WRITE, t1 b READ;
|
||||
|
||||
UNLOCK TABLES;
|
||||
|
||||
--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF
|
||||
ALTER TABLE t1 ADD COLUMN (s3 VARCHAR(5) UNIQUE);
|
||||
|
||||
# The SELECT below used to hang in tdc_wait_for_old_versions().
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#51868 - crash with myisam_use_mmap and partitioned myisam tables
|
||||
--echo #
|
||||
|
@@ -11,6 +11,16 @@ select @@debug;
|
||||
set debug= '-P';
|
||||
select @@debug;
|
||||
|
||||
#
|
||||
# Bug#38054: "SET SESSION debug" modifies @@global.debug variable
|
||||
#
|
||||
|
||||
SELECT @@session.debug, @@global.debug;
|
||||
|
||||
SET SESSION debug = '';
|
||||
|
||||
SELECT @@session.debug, @@global.debug;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #52629: memory leak from sys_var_thd_dbug in
|
||||
--echo # binlog.binlog_write_error
|
||||
|
Reference in New Issue
Block a user