468 changed files with 41872 additions and 3201 deletions
-
24CREDITS
-
101client/mysql.cc
-
2client/mysql_upgrade.c
-
5client/mysqldump.c
-
2client/mysqlimport.c
-
45client/mysqltest.cc
-
7cmake/cpack_rpm.cmake
-
7cmake/ssl.cmake
-
2debian/compat
-
7include/my_global.h
-
2include/my_sys.h
-
2include/mysql_com.h
-
2include/service_versions.h
-
5libmysql/libmysql.c
-
8mysql-test/include/innodb_page_size.combinations
-
4mysql-test/include/innodb_page_size.inc
-
8mysql-test/include/innodb_page_size_small.combinations
-
4mysql-test/include/innodb_page_size_small.inc
-
7mysql-test/include/wait_for_slave_sql_error_and_skip.inc
-
37mysql-test/mysql-test-run.pl
-
111mysql-test/r/alter_table_online.result
-
117mysql-test/r/binary_to_hex.result
-
2mysql-test/r/contributors.result
-
12mysql-test/r/count_distinct.result
-
17mysql-test/r/ctype_ucs.result
-
6mysql-test/r/engine_error_in_alter-8453.result
-
113mysql-test/r/func_concat.result
-
18mysql-test/r/func_crypt.result
-
32mysql-test/r/func_regexp_pcre.result
-
51mysql-test/r/gis-alter_table_online.result
-
22mysql-test/r/gis-rt-precise.result
-
26mysql-test/r/gis.result
-
27mysql-test/r/group_by.result
-
95mysql-test/r/join_outer.result
-
95mysql-test/r/join_outer_jcl6.result
-
16mysql-test/r/loadxml.result
-
2mysql-test/r/myisam_debug.result
-
58mysql-test/r/mysql.result
-
23mysql-test/r/mysql_upgrade.result
-
5mysql-test/r/mysqltest.result
-
2mysql-test/r/read_only.result
-
47mysql-test/r/subselect.result
-
88mysql-test/r/subselect_mat.result
-
17mysql-test/r/subselect_mat_cost_bugs.result
-
47mysql-test/r/subselect_no_exists_to_in.result
-
47mysql-test/r/subselect_no_mat.result
-
47mysql-test/r/subselect_no_opts.result
-
47mysql-test/r/subselect_no_scache.result
-
47mysql-test/r/subselect_no_semijoin.result
-
6mysql-test/r/subselect_nulls.result
-
22mysql-test/r/subselect_sj2_mat.result
-
88mysql-test/r/subselect_sj_mat.result
-
18mysql-test/r/union.result
-
76mysql-test/r/view.result
-
8mysql-test/std_data/loadxml.dat
-
4mysql-test/suite/archive/archive_gis.result
-
22mysql-test/suite/binlog/r/binlog_unsafe.result
-
22mysql-test/suite/binlog/t/binlog_unsafe.test
-
9mysql-test/suite/innodb/r/drop_table_background.result
-
2mysql-test/suite/innodb/r/innodb-get-fk.result
-
4mysql-test/suite/innodb/r/innodb_gis.result
-
48mysql-test/suite/innodb/r/row_format_redundant.result
-
83mysql-test/suite/innodb/r/table_flags,4k.rdiff
-
83mysql-test/suite/innodb/r/table_flags,8k.rdiff
-
175mysql-test/suite/innodb/r/table_flags.result
-
30mysql-test/suite/innodb/t/drop_table_background.test
-
2mysql-test/suite/innodb/t/innodb-alter-debug.test
-
2mysql-test/suite/innodb/t/innodb-alter-discard.test
-
2mysql-test/suite/innodb/t/innodb-alter-nullable.test
-
2mysql-test/suite/innodb/t/innodb-alter-table.test
-
3mysql-test/suite/innodb/t/innodb-alter-tempfile.test
-
2mysql-test/suite/innodb/t/innodb-get-fk.test
-
8mysql-test/suite/innodb/t/log_file_size.test
-
63mysql-test/suite/innodb/t/row_format_redundant.test
-
190mysql-test/suite/innodb/t/table_flags.test
-
2mysql-test/suite/innodb_zip/r/innodb-zip.result
-
2mysql-test/suite/innodb_zip/t/innodb-create-options.test
-
11mysql-test/suite/innodb_zip/t/innodb-zip.test
-
2mysql-test/suite/innodb_zip/t/innodb_bug36169.test
-
2mysql-test/suite/innodb_zip/t/innodb_bug36172.test
-
2mysql-test/suite/innodb_zip/t/innodb_bug52745.test
-
2mysql-test/suite/innodb_zip/t/innodb_bug53591.test
-
2mysql-test/suite/innodb_zip/t/innodb_bug56680.test
-
37mysql-test/suite/parts/r/longname.result
-
6mysql-test/suite/parts/r/quoting.result
-
32mysql-test/suite/parts/t/longname.test
-
10mysql-test/suite/parts/t/quoting.test
-
1mysql-test/suite/perfschema/t/privilege.test
-
103mysql-test/suite/roles/current_role_view-12666.result
-
102mysql-test/suite/roles/current_role_view-12666.test
-
65mysql-test/suite/roles/show_create_database-10463.result
-
55mysql-test/suite/roles/show_create_database-10463.test
-
30mysql-test/suite/rpl/r/circular_serverid0.result
-
29mysql-test/suite/rpl/r/rpl_reset_slave_fail.result
-
30mysql-test/suite/rpl/t/circular_serverid0.cnf
-
104mysql-test/suite/rpl/t/circular_serverid0.test
-
91mysql-test/suite/rpl/t/rpl_reset_slave_fail.test
-
4mysql-test/suite/storage_engine/type_spatial.result
-
8mysql-test/suite/storage_engine/type_spatial_indexes.result
-
2mysql-test/suite/sys_vars/r/innodb_sched_priority_cleaner_basic.result
@ -1 +1 @@ |
|||
5 |
|||
9 |
@ -0,0 +1,8 @@ |
|||
[16k] |
|||
innodb-page-size=16K |
|||
|
|||
[8k] |
|||
innodb-page-size=8K |
|||
|
|||
[4k] |
|||
innodb-page-size=4K |
@ -0,0 +1,4 @@ |
|||
# The goal of including this file is to enable innodb_page_size combinations |
|||
# (see include/innodb_page_size.combinations) |
|||
|
|||
--source include/have_innodb.inc |
@ -0,0 +1,8 @@ |
|||
[16k] |
|||
innodb-page-size=16K |
|||
|
|||
[8k] |
|||
innodb-page-size=8K |
|||
|
|||
[4k] |
|||
innodb-page-size=4K |
@ -0,0 +1,4 @@ |
|||
# The goal of including this file is to enable innodb_page_size combinations |
|||
# (see include/innodb_page_size.combinations) |
|||
|
|||
--source include/have_innodb.inc |
@ -0,0 +1,117 @@ |
|||
USE test; |
|||
DROP TABLE IF EXISTS t1, t2; |
|||
CREATE TABLE t1 (c1 TINYBLOB, |
|||
c2 BLOB, |
|||
c3 MEDIUMBLOB, |
|||
c4 LONGBLOB, |
|||
c5 TEXT, |
|||
c6 BIT(1), |
|||
c7 CHAR, |
|||
c8 VARCHAR(10), |
|||
c9 GEOMETRY) CHARACTER SET = binary; |
|||
SHOW CREATE TABLE t1; |
|||
Table Create Table |
|||
t1 CREATE TABLE `t1` ( |
|||
`c1` tinyblob, |
|||
`c2` blob, |
|||
`c3` mediumblob, |
|||
`c4` longblob, |
|||
`c5` blob, |
|||
`c6` bit(1) DEFAULT NULL, |
|||
`c7` binary(1) DEFAULT NULL, |
|||
`c8` varbinary(10) DEFAULT NULL, |
|||
`c9` geometry DEFAULT NULL |
|||
) ENGINE=MyISAM DEFAULT CHARSET=binary |
|||
INSERT INTO t1 VALUES ('tinyblob-text readable', 'blob-text readable', |
|||
'mediumblob-text readable', 'longblob-text readable', |
|||
'text readable', b'1', 'c', 'variable', |
|||
POINT(1, 1)); |
|||
CREATE TABLE t2(id int, `col1` binary(10),`col2` blob); |
|||
SHOW CREATE TABLE t2; |
|||
Table Create Table |
|||
t2 CREATE TABLE `t2` ( |
|||
`id` int(11) DEFAULT NULL, |
|||
`col1` binary(10) DEFAULT NULL, |
|||
`col2` blob |
|||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
|||
INSERT INTO t2 VALUES (1, X'AB1234', X'123ABC'), (2, X'DE1234', X'123DEF'); |
|||
#Print the table contents when binary-as-hex option is off. |
|||
SELECT * FROM t1; |
|||
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
|||
tinyblob-text readable blob-text readable mediumblob-text readable longblob-text readable text readable # c variable # |
|||
SELECT * FROM t2; |
|||
id col1 col2 |
|||
1 # # |
|||
2 # # |
|||
#Print the table contents after turning on the binary-as-hex option |
|||
|
|||
#Print the table contents in tab format |
|||
|
|||
c1 c2 c3 c4 c5 c6 c7 c8 c9 |
|||
0x74696E79626C6F622D74657874207265616461626C65 0x626C6F622D74657874207265616461626C65 0x6D656469756D626C6F622D74657874207265616461626C65 0x6C6F6E67626C6F622D74657874207265616461626C65 0x74657874207265616461626C65 0x01 0x63 0x7661726961626C65 0x000000000101000000000000000000F03F000000000000F03F |
|||
id col1 col2 |
|||
1 0xAB123400000000000000 0x123ABC |
|||
2 0xDE123400000000000000 0x123DEF |
|||
|
|||
#Print the table contents in table format |
|||
|
|||
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ |
|||
| c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8 | c9 | |
|||
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ |
|||
| 0x74696E79626C6F622D74657874207265616461626C65 | 0x626C6F622D74657874207265616461626C65 | 0x6D656469756D626C6F622D74657874207265616461626C65 | 0x6C6F6E67626C6F622D74657874207265616461626C65 | 0x74657874207265616461626C65 | 0x01 | 0x63 | 0x7661726961626C65 | 0x000000000101000000000000000000F03F000000000000F03F | |
|||
+------------------------------------------------+----------------------------------------+----------------------------------------------------+------------------------------------------------+------------------------------+------------+------------+--------------------+------------------------------------------------------+ |
|||
+------+------------------------+------------+ |
|||
| id | col1 | col2 | |
|||
+------+------------------------+------------+ |
|||
| 1 | 0xAB123400000000000000 | 0x123ABC | |
|||
+------+------------------------+------------+ |
|||
|
|||
#Print the table contents vertically |
|||
|
|||
*************************** 1. row *************************** |
|||
c1: 0x74696E79626C6F622D74657874207265616461626C65 |
|||
c2: 0x626C6F622D74657874207265616461626C65 |
|||
c3: 0x6D656469756D626C6F622D74657874207265616461626C65 |
|||
c4: 0x6C6F6E67626C6F622D74657874207265616461626C65 |
|||
c5: 0x74657874207265616461626C65 |
|||
c6: 0x01 |
|||
c7: 0x63 |
|||
c8: 0x7661726961626C65 |
|||
c9: 0x000000000101000000000000000000F03F000000000000F03F |
|||
|
|||
#Print the table contents in xml format |
|||
|
|||
<?xml version="1.0"?> |
|||
|
|||
<resultset statement="SELECT * FROM t1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
|||
<row> |
|||
<field name="c1">0x74696E79626C6F622D74657874207265616461626C65</field> |
|||
<field name="c2">0x626C6F622D74657874207265616461626C65</field> |
|||
<field name="c3">0x6D656469756D626C6F622D74657874207265616461626C65</field> |
|||
<field name="c4">0x6C6F6E67626C6F622D74657874207265616461626C65</field> |
|||
<field name="c5">0x74657874207265616461626C65</field> |
|||
<field name="c6">0x01</field> |
|||
<field name="c7">0x63</field> |
|||
<field name="c8">0x7661726961626C65</field> |
|||
<field name="c9">0x000000000101000000000000000000F03F000000000000F03F</field> |
|||
</row> |
|||
</resultset> |
|||
<?xml version="1.0"?> |
|||
|
|||
<resultset statement="SELECT * FROM t2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
|||
<row> |
|||
<field name="id">1</field> |
|||
<field name="col1">0xAB123400000000000000</field> |
|||
<field name="col2">0x123ABC</field> |
|||
</row> |
|||
|
|||
<row> |
|||
<field name="id">2</field> |
|||
<field name="col1">0xDE123400000000000000</field> |
|||
<field name="col2">0x123DEF</field> |
|||
</row> |
|||
</resultset> |
|||
|
|||
#Print the table contents in html format |
|||
|
|||
<TABLE BORDER=1><TR><TH>c1</TH><TH>c2</TH><TH>c3</TH><TH>c4</TH><TH>c5</TH><TH>c6</TH><TH>c7</TH><TH>c8</TH><TH>c9</TH></TR><TR><TD>0x74696E79626C6F622D74657874207265616461626C65</TD><TD>0x626C6F622D74657874207265616461626C65</TD><TD>0x6D656469756D626C6F622D74657874207265616461626C65</TD><TD>0x6C6F6E67626C6F622D74657874207265616461626C65</TD><TD>0x74657874207265616461626C65</TD><TD>0x01</TD><TD>0x63</TD><TD>0x7661726961626C65</TD><TD>0x000000000101000000000000000000F03F000000000000F03F</TD></TR></TABLE><TABLE BORDER=1><TR><TH>id</TH><TH>col1</TH><TH>col2</TH></TR><TR><TD>1</TD><TD>0xAB123400000000000000</TD><TD>0x123ABC</TD></TR><TR><TD>2</TD><TD>0xDE123400000000000000</TD><TD>0x123DEF</TD></TR></TABLE>DROP TABLE t1, t2; |
@ -0,0 +1,6 @@ |
|||
create table t1 (a int, b int); |
|||
set debug_dbug='+d,external_lock_failure'; |
|||
alter table t1 add column c int; |
|||
ERROR HY000: Got error 168 'KABOOM!' from MyISAM |
|||
set debug_dbug=''; |
|||
drop table t1; |
@ -0,0 +1,51 @@ |
|||
# |
|||
# Start of 10.1 tests |
|||
# |
|||
# |
|||
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB |
|||
# |
|||
CREATE TABLE t1 (a TINYBLOB); |
|||
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a MEDIUMBLOB); |
|||
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a BLOB); |
|||
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a LONGBLOB); |
|||
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a GEOMETRY); |
|||
ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a GEOMETRY); |
|||
ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a GEOMETRY); |
|||
ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a GEOMETRY); |
|||
ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a GEOMETRY); |
|||
ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE; |
|||
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a POLYGON); |
|||
ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1 (a POLYGON); |
|||
ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE; |
|||
DROP TABLE t1; |
|||
# |
|||
# End of 10.1 tests |
|||
# |
@ -0,0 +1,9 @@ |
|||
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, |
|||
KEY(c1), KEY(c2), KEY(c2,c1), |
|||
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), |
|||
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), |
|||
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; |
|||
SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; |
|||
DROP TABLE t; |
|||
CREATE TABLE t (a INT) ENGINE=InnoDB; |
|||
DROP TABLE t; |
@ -0,0 +1,48 @@ |
|||
create table t1 (a int not null, d varchar(15) not null, b |
|||
varchar(198) not null, c char(156), |
|||
fulltext ftsic(c)) engine=InnoDB |
|||
row_format=redundant; |
|||
insert into t1 values(123, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(456, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(789, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(134, 'kasdfsdsadf', 'adfjlasdkfjasd', 'adfsadflkasdasdfljasdf'); |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
create table t2 (a int not null, d varchar(15) not null, b |
|||
varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB |
|||
row_format=redundant; |
|||
insert into t2 select * from t1; |
|||
create table t3 (a int not null, d varchar(15) not null, b varchar(198), |
|||
c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB |
|||
row_format=redundant; |
|||
insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa'); |
|||
insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa'); |
|||
SET GLOBAL innodb_fast_shutdown=0; |
|||
SELECT COUNT(*) FROM t1; |
|||
COUNT(*) |
|||
4096 |
|||
SELECT COUNT(*) FROM t2; |
|||
COUNT(*) |
|||
4096 |
|||
SELECT COUNT(*) FROM t3; |
|||
COUNT(*) |
|||
2 |
|||
TRUNCATE TABLE t1; |
|||
ERROR HY000: Table 't1' is read only |
|||
TRUNCATE TABLE t2; |
|||
ERROR HY000: Table 't2' is read only |
|||
TRUNCATE TABLE t3; |
|||
ERROR HY000: Table 't3' is read only |
|||
TRUNCATE TABLE t1; |
|||
TRUNCATE TABLE t2; |
|||
TRUNCATE TABLE t3; |
|||
DROP TABLE t1,t2,t3; |
@ -0,0 +1,83 @@ |
|||
--- suite/innodb/r/table_flags.result |
|||
+++ suite/innodb/r/table_flags,4k.reject |
|||
@@ -13,7 +13,7 @@ |
|||
header=0x01000003016e (NAME=0x696e66696d756d00) |
|||
header=0x00002815008d (NAME='SYS_DATAFILES', |
|||
DB_TRX_ID=0x000000000301, |
|||
- DB_ROLL_PTR=0x81000001320194, |
|||
+ DB_ROLL_PTR=0x81000003260194, |
|||
ID=0x000000000000000e, |
|||
N_COLS=0x00000002, |
|||
TYPE=0x00000001, |
|||
@@ -23,7 +23,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x0000101500d5 (NAME='SYS_FOREIGN', |
|||
DB_TRX_ID=0x000000000300, |
|||
- DB_ROLL_PTR=0x800000012d0110, |
|||
+ DB_ROLL_PTR=0x80000003200110, |
|||
ID=0x000000000000000b, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
@@ -33,7 +33,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS', |
|||
DB_TRX_ID=0x000000000300, |
|||
- DB_ROLL_PTR=0x800000012d0201, |
|||
+ DB_ROLL_PTR=0x80000003200201, |
|||
ID=0x000000000000000c, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
@@ -43,7 +43,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x0400201501fc (NAME='SYS_TABLESPACES', |
|||
DB_TRX_ID=0x000000000301, |
|||
- DB_ROLL_PTR=0x81000001320110, |
|||
+ DB_ROLL_PTR=0x81000003260110, |
|||
ID=0x000000000000000d, |
|||
N_COLS=0x00000003, |
|||
TYPE=0x00000001, |
|||
@@ -53,7 +53,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x000038150240 (NAME='test/tc', |
|||
DB_TRX_ID=0x000000000303, |
|||
- DB_ROLL_PTR=0x83000001360110, |
|||
+ DB_ROLL_PTR=0x830000032b0110, |
|||
ID=0x0000000000000010, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000001, |
|||
@@ -63,7 +63,7 @@ |
|||
SPACE=0x00000002) |
|||
header=0x0000401502c8 (NAME='test/td', |
|||
DB_TRX_ID=0x000000000304, |
|||
- DB_ROLL_PTR=0x84000001370110, |
|||
+ DB_ROLL_PTR=0x840000032c0110, |
|||
ID=0x0000000000000011, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
@@ -73,7 +73,7 @@ |
|||
SPACE=0x00000003) |
|||
header=0x0000501501b8 (NAME='test/tp', |
|||
DB_TRX_ID=0x000000000306, |
|||
- DB_ROLL_PTR=0x86000001390110, |
|||
+ DB_ROLL_PTR=0x860000032e0110, |
|||
ID=0x0000000000000013, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
@@ -83,7 +83,7 @@ |
|||
SPACE=0x00000005) |
|||
header=0x000030150284 (NAME='test/tr', |
|||
DB_TRX_ID=0x000000000302, |
|||
- DB_ROLL_PTR=0x82000001350110, |
|||
+ DB_ROLL_PTR=0x820000032a0110, |
|||
ID=0x000000000000000f, |
|||
N_COLS=0x00000001, |
|||
TYPE=0x00000001, |
|||
@@ -93,7 +93,7 @@ |
|||
SPACE=0x00000001) |
|||
header=0x000048150074 (NAME='test/tz', |
|||
DB_TRX_ID=0x000000000305, |
|||
- DB_ROLL_PTR=0x85000001380110, |
|||
+ DB_ROLL_PTR=0x850000032d0110, |
|||
ID=0x0000000000000012, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000023, |
@ -0,0 +1,83 @@ |
|||
--- suite/innodb/r/table_flags.result |
|||
+++ suite/innodb/r/table_flags,8k.reject |
|||
@@ -13,7 +13,7 @@ |
|||
header=0x01000003016e (NAME=0x696e66696d756d00) |
|||
header=0x00002815008d (NAME='SYS_DATAFILES', |
|||
DB_TRX_ID=0x000000000301, |
|||
- DB_ROLL_PTR=0x81000001320194, |
|||
+ DB_ROLL_PTR=0x81000001d70194, |
|||
ID=0x000000000000000e, |
|||
N_COLS=0x00000002, |
|||
TYPE=0x00000001, |
|||
@@ -23,7 +23,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x0000101500d5 (NAME='SYS_FOREIGN', |
|||
DB_TRX_ID=0x000000000300, |
|||
- DB_ROLL_PTR=0x800000012d0110, |
|||
+ DB_ROLL_PTR=0x80000001d10110, |
|||
ID=0x000000000000000b, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
@@ -33,7 +33,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS', |
|||
DB_TRX_ID=0x000000000300, |
|||
- DB_ROLL_PTR=0x800000012d0201, |
|||
+ DB_ROLL_PTR=0x80000001d10201, |
|||
ID=0x000000000000000c, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
@@ -43,7 +43,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x0400201501fc (NAME='SYS_TABLESPACES', |
|||
DB_TRX_ID=0x000000000301, |
|||
- DB_ROLL_PTR=0x81000001320110, |
|||
+ DB_ROLL_PTR=0x81000001d70110, |
|||
ID=0x000000000000000d, |
|||
N_COLS=0x00000003, |
|||
TYPE=0x00000001, |
|||
@@ -53,7 +53,7 @@ |
|||
SPACE=0x00000000) |
|||
header=0x000038150240 (NAME='test/tc', |
|||
DB_TRX_ID=0x000000000303, |
|||
- DB_ROLL_PTR=0x83000001360110, |
|||
+ DB_ROLL_PTR=0x83000001db0110, |
|||
ID=0x0000000000000010, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000001, |
|||
@@ -63,7 +63,7 @@ |
|||
SPACE=0x00000002) |
|||
header=0x0000401502c8 (NAME='test/td', |
|||
DB_TRX_ID=0x000000000304, |
|||
- DB_ROLL_PTR=0x84000001370110, |
|||
+ DB_ROLL_PTR=0x84000001dc0110, |
|||
ID=0x0000000000000011, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
@@ -73,7 +73,7 @@ |
|||
SPACE=0x00000003) |
|||
header=0x0000501501b8 (NAME='test/tp', |
|||
DB_TRX_ID=0x000000000306, |
|||
- DB_ROLL_PTR=0x86000001390110, |
|||
+ DB_ROLL_PTR=0x86000001de0110, |
|||
ID=0x0000000000000013, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
@@ -83,7 +83,7 @@ |
|||
SPACE=0x00000005) |
|||
header=0x000030150284 (NAME='test/tr', |
|||
DB_TRX_ID=0x000000000302, |
|||
- DB_ROLL_PTR=0x82000001350110, |
|||
+ DB_ROLL_PTR=0x82000001da0110, |
|||
ID=0x000000000000000f, |
|||
N_COLS=0x00000001, |
|||
TYPE=0x00000001, |
|||
@@ -93,7 +93,7 @@ |
|||
SPACE=0x00000001) |
|||
header=0x000048150074 (NAME='test/tz', |
|||
DB_TRX_ID=0x000000000305, |
|||
- DB_ROLL_PTR=0x85000001380110, |
|||
+ DB_ROLL_PTR=0x85000001dd0110, |
|||
ID=0x0000000000000012, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000023, |
@ -0,0 +1,175 @@ |
|||
SET GLOBAL innodb_file_per_table=1; |
|||
CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; |
|||
CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT; |
|||
CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; |
|||
CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED |
|||
KEY_BLOCK_SIZE=1; |
|||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC |
|||
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; |
|||
ERROR HY000: Unknown option 'PAGE_COMPRESSED' |
|||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; |
|||
SYS_TABLES clustered index root page (8): |
|||
N_RECS=9; LEVEL=0; INDEX_ID=0x0000000000000001 |
|||
header=0x01000003016e (NAME=0x696e66696d756d00) |
|||
header=0x00002815008d (NAME='SYS_DATAFILES', |
|||
DB_TRX_ID=0x000000000301, |
|||
DB_ROLL_PTR=0x81000001320194, |
|||
ID=0x000000000000000e, |
|||
N_COLS=0x00000002, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000040, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000000) |
|||
header=0x0000101500d5 (NAME='SYS_FOREIGN', |
|||
DB_TRX_ID=0x000000000300, |
|||
DB_ROLL_PTR=0x800000012d0110, |
|||
ID=0x000000000000000b, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000040, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000000) |
|||
header=0x000018150122 (NAME='SYS_FOREIGN_COLS', |
|||
DB_TRX_ID=0x000000000300, |
|||
DB_ROLL_PTR=0x800000012d0201, |
|||
ID=0x000000000000000c, |
|||
N_COLS=0x00000004, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000040, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000000) |
|||
header=0x0400201501fc (NAME='SYS_TABLESPACES', |
|||
DB_TRX_ID=0x000000000301, |
|||
DB_ROLL_PTR=0x81000001320110, |
|||
ID=0x000000000000000d, |
|||
N_COLS=0x00000003, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000040, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000000) |
|||
header=0x000038150240 (NAME='test/tc', |
|||
DB_TRX_ID=0x000000000303, |
|||
DB_ROLL_PTR=0x83000001360110, |
|||
ID=0x0000000000000010, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000050, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000002) |
|||
header=0x0000401502c8 (NAME='test/td', |
|||
DB_TRX_ID=0x000000000304, |
|||
DB_ROLL_PTR=0x84000001370110, |
|||
ID=0x0000000000000011, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000050, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000003) |
|||
header=0x0000501501b8 (NAME='test/tp', |
|||
DB_TRX_ID=0x000000000306, |
|||
DB_ROLL_PTR=0x86000001390110, |
|||
ID=0x0000000000000013, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000021, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000050, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000005) |
|||
header=0x000030150284 (NAME='test/tr', |
|||
DB_TRX_ID=0x000000000302, |
|||
DB_ROLL_PTR=0x82000001350110, |
|||
ID=0x000000000000000f, |
|||
N_COLS=0x00000001, |
|||
TYPE=0x00000001, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000050, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000001) |
|||
header=0x000048150074 (NAME='test/tz', |
|||
DB_TRX_ID=0x000000000305, |
|||
DB_ROLL_PTR=0x85000001380110, |
|||
ID=0x0000000000000012, |
|||
N_COLS=0x80000001, |
|||
TYPE=0x00000023, |
|||
MIX_ID=0x0000000000000000, |
|||
MIX_LEN=0x00000050, |
|||
CLUSTER_NAME=NULL(0 bytes), |
|||
SPACE=0x00000004) |
|||
header=0x060008030000 (NAME=0x73757072656d756d00) |
|||
SHOW CREATE TABLE tr; |
|||
Table Create Table |
|||
tr CREATE TABLE `tr` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT |
|||
INSERT INTO tr VALUES(42); |
|||
SHOW CREATE TABLE tc; |
|||
ERROR 42S02: Table 'test.tc' doesn't exist in engine |
|||
SHOW CREATE TABLE td; |
|||
ERROR 42S02: Table 'test.td' doesn't exist in engine |
|||
SHOW CREATE TABLE tz; |
|||
ERROR 42S02: Table 'test.tz' doesn't exist in engine |
|||
SHOW CREATE TABLE tp; |
|||
ERROR 42S02: Table 'test.tp' doesn't exist in engine |
|||
FOUND /InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)/ in mysqld.1.err |
|||
FOUND /InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB/ in mysqld.1.err |
|||
Restoring SYS_TABLES clustered index root page (8) |
|||
SHOW CREATE TABLE tr; |
|||
Table Create Table |
|||
tr CREATE TABLE `tr` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT |
|||
SHOW CREATE TABLE tc; |
|||
Table Create Table |
|||
tc CREATE TABLE `tc` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT |
|||
SHOW CREATE TABLE td; |
|||
Table Create Table |
|||
td CREATE TABLE `td` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
SHOW CREATE TABLE tz; |
|||
Table Create Table |
|||
tz CREATE TABLE `tz` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 |
|||
SHOW CREATE TABLE tp; |
|||
Table Create Table |
|||
tp CREATE TABLE `tp` ( |
|||
`a` int(11) NOT NULL, |
|||
PRIMARY KEY (`a`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
BEGIN; |
|||
INSERT INTO tr VALUES(1); |
|||
INSERT INTO tc VALUES(1); |
|||
INSERT INTO td VALUES(1); |
|||
INSERT INTO tz VALUES(1); |
|||
INSERT INTO tp VALUES(1); |
|||
ROLLBACK; |
|||
SELECT * FROM tr; |
|||
a |
|||
42 |
|||
SELECT * FROM tc; |
|||
a |
|||
SELECT * FROM td; |
|||
a |
|||
SELECT * FROM tz; |
|||
a |
|||
SELECT * FROM tp; |
|||
a |
|||
DROP TABLE tr,tc,td,tz,tp; |
|||
ib_logfile0 |
|||
ib_logfile1 |
|||
ibdata1 |
|||
sys_tables.bin |
@ -0,0 +1,30 @@ |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
# Embedded server does not support restarting |
|||
--source include/not_embedded.inc |
|||
|
|||
CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, |
|||
KEY(c1), KEY(c2), KEY(c2,c1), |
|||
KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), |
|||
KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), |
|||
KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; |
|||
|
|||
let $n= 10; |
|||
|
|||
SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; |
|||
--disable_query_log |
|||
let $i= $n; |
|||
while ($i) { |
|||
eval CREATE TABLE t$i LIKE t; |
|||
dec $i; |
|||
} |
|||
let $i= $n; |
|||
while ($i) { |
|||
eval DROP TABLE t$i; |
|||
dec $i; |
|||
} |
|||
--enable_query_log |
|||
DROP TABLE t; |
|||
--source include/restart_mysqld.inc |
|||
CREATE TABLE t (a INT) ENGINE=InnoDB; |
|||
DROP TABLE t; |
@ -0,0 +1,63 @@ |
|||
--source include/have_innodb.inc |
|||
# Embedded mode doesn't allow restarting |
|||
--source include/not_embedded.inc |
|||
|
|||
create table t1 (a int not null, d varchar(15) not null, b |
|||
varchar(198) not null, c char(156), |
|||
fulltext ftsic(c)) engine=InnoDB |
|||
row_format=redundant; |
|||
|
|||
insert into t1 values(123, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(456, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(789, 'abcdef', 'jghikl', 'mnop'); |
|||
insert into t1 values(134, 'kasdfsdsadf', 'adfjlasdkfjasd', 'adfsadflkasdasdfljasdf'); |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
insert into t1 select * from t1; |
|||
|
|||
SET GLOBAL innodb_file_per_table=OFF; |
|||
create table t2 (a int not null, d varchar(15) not null, b |
|||
varchar(198) not null, c char(156), fulltext ftsic(c)) engine=InnoDB |
|||
row_format=redundant; |
|||
|
|||
insert into t2 select * from t1; |
|||
|
|||
create table t3 (a int not null, d varchar(15) not null, b varchar(198), |
|||
c varchar(150), index k1(c(99), b(56)), index k2(b(5), c(10))) engine=InnoDB |
|||
row_format=redundant; |
|||
|
|||
insert into t3 values(444, 'dddd', 'bbbbb', 'aaaaa'); |
|||
insert into t3 values(555, 'eeee', 'ccccc', 'aaaaa'); |
|||
|
|||
# read-only restart requires the change buffer to be empty; therefore we |
|||
# do a slow shutdown. |
|||
SET GLOBAL innodb_fast_shutdown=0; |
|||
--let $restart_parameters = --innodb-read-only |
|||
--source include/restart_mysqld.inc |
|||
|
|||
SELECT COUNT(*) FROM t1; |
|||
SELECT COUNT(*) FROM t2; |
|||
SELECT COUNT(*) FROM t3; |
|||
|
|||
--error ER_OPEN_AS_READONLY |
|||
TRUNCATE TABLE t1; |
|||
--error ER_OPEN_AS_READONLY |
|||
TRUNCATE TABLE t2; |
|||
--error ER_OPEN_AS_READONLY |
|||
TRUNCATE TABLE t3; |
|||
|
|||
--let $restart_parameters = |
|||
--source include/restart_mysqld.inc |
|||
|
|||
TRUNCATE TABLE t1; |
|||
TRUNCATE TABLE t2; |
|||
TRUNCATE TABLE t3; |
|||
|
|||
DROP TABLE t1,t2,t3; |
@ -0,0 +1,190 @@ |
|||
--source include/innodb_page_size.inc |
|||
# Embedded server tests do not support restarting |
|||
--source include/not_embedded.inc |
|||
|
|||
--disable_query_log |
|||
call mtr.add_suppression("InnoDB: New log files created, LSN="); |
|||
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables"); |
|||
call mtr.add_suppression("InnoDB: Error: .*innodb_table_stats. not found"); |
|||
call mtr.add_suppression("InnoDB: Table '.test.\\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023)"); |
|||
call mtr.add_suppression("InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB"); |
|||
call mtr.add_suppression("InnoDB: Error: table 'test/t[cdzp]'"); |
|||
FLUSH TABLES; |
|||
--enable_query_log |
|||
|
|||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`; |
|||
let MYSQLD_DATADIR=`select @@datadir`; |
|||
|
|||
let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags; |
|||
--mkdir $bugdir |
|||
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err |
|||
|
|||
--let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir |
|||
--let $d=$d --innodb-data-file-path=ibdata1:10M:autoextend |
|||
--let $d=$d --innodb-undo-tablespaces=0 |
|||
--let $restart_parameters=$d --innodb-stats-persistent=0 --innodb-file-format=1 |
|||
--source include/restart_mysqld.inc |
|||
|
|||
SET GLOBAL innodb_file_per_table=1; |
|||
CREATE TABLE tr(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=REDUNDANT; |
|||
CREATE TABLE tc(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPACT; |
|||
CREATE TABLE td(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; |
|||
CREATE TABLE tz(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=COMPRESSED |
|||
KEY_BLOCK_SIZE=1; |
|||
# PAGE_COMPRESSED is supported starting with MariaDB 10.1.0 |
|||
--error ER_UNKNOWN_OPTION |
|||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC |
|||
PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; |
|||
CREATE TABLE tp(a INT PRIMARY KEY)ENGINE=InnoDB ROW_FORMAT=DYNAMIC; |
|||
|
|||
--source include/shutdown_mysqld.inc |
|||
--perl |
|||
use strict; |
|||
my $ps= $ENV{INNODB_PAGE_SIZE}; |
|||
my $file= "$ENV{bugdir}/ibdata1"; |
|||
open(FILE, "+<", $file) || die "Unable to open $file\n"; |
|||
# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). |
|||
sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; |
|||
die "Unable to read $file" unless sysread(FILE, $_, 4) == 4; |
|||
my $sys_tables_root = unpack("N", $_); |
|||
my $page; |
|||
print "SYS_TABLES clustered index root page ($sys_tables_root):\n"; |
|||
sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; |
|||
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps; |
|||
open(BACKUP, ">$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n"; |
|||
syswrite(BACKUP, $page, $ps)==$ps || die "Unable to write backup\n"; |
|||
close(BACKUP) || die "Unable to close backup\n"; |
|||
print "N_RECS=", unpack("n", substr($page,38+16,2)); |
|||
print "; LEVEL=", unpack("n", substr($page,38+26,2)); |
|||
print "; INDEX_ID=0x", unpack("H*", substr($page,38+28,8)), "\n"; |
|||
my @fields=("NAME","DB_TRX_ID","DB_ROLL_PTR", |
|||
"ID","N_COLS","TYPE","MIX_ID","MIX_LEN","CLUSTER_NAME","SPACE"); |
|||
for (my $offset= 0x65; $offset; |
|||
$offset= unpack("n", substr($page,$offset-2,2))) |
|||
{ |
|||
print "header=0x", unpack("H*",substr($page,$offset-6,6)), " ("; |
|||
my $n_fields= unpack("n", substr($page,$offset-4,2)) >> 1 & 0x3ff; |
|||
my $start= 0; |
|||
my $name; |
|||
for (my $i= 0; $i < $n_fields; $i++) { |
|||
my $end= unpack("C", substr($page, $offset-7-$i, 1)); |
|||
print ",\n " if $i; |
|||
print "$fields[$i]="; |
|||
if ($end & 0x80) { |
|||
print "NULL(", ($end & 0x7f) - $start, " bytes)" |
|||
} elsif ($n_fields > 1 && $i == 0) { |
|||
$name= substr($page,$offset+$start,$end-$start); |
|||
print "'$name'" |
|||
} else { |
|||
print "0x", unpack("H*", substr($page,$offset+$start,$end-$start)) |
|||
} |
|||
# Corrupt SYS_TABLES.TYPE |
|||
if ($i == 5) |
|||
{ |
|||
my $flags= 0; |
|||
if ($name eq 'test/tr') { |
|||
# $flags= 0x40 # DATA_DIR mismatch causes 10.0 crash! |
|||
} elsif ($name eq 'test/tc') { |
|||
$flags= 0x80 # 10.1 PAGE_COMPRESSED |
|||
} elsif ($name eq 'test/td') { |
|||
$flags= 0xf00 # 10.1 PAGE_COMPRESSION_LEVEL=15 (0..9 is valid) |
|||
} elsif ($name eq 'test/tz') { |
|||
$flags= 0x3000 # 10.1 ATOMIC_WRITES=3 (0..2 is valid) |
|||
} elsif ($name eq 'test/tp') { |
|||
$flags= 0x880 # 10.1 PAGE_COMPRESSED, PAGE_COMPRESSION_LEVEL=8 |
|||
# (in 10.1, this leaves PAGE_COMPRESSION_LEVEL=1 |
|||
# without PAGE_COMPRESSED, which should be invalid) |
|||
} |
|||
|
|||
substr($page,$offset+$start,$end-$start)= pack( |
|||
"N", $flags ^ |
|||
unpack("N", substr($page,$offset+$start,$end-$start))) |
|||
if $flags; |
|||
} |
|||
# Corrupt SYS_TABLES.MIX_LEN (ignored for ROW_FORMAT=REDUNDANT) |
|||
if ($i == 7 && $name eq 'test/tr') |
|||
{ |
|||
substr($page,$offset+$start,$end-$start)= chr(255) x 4; |
|||
} |
|||
$start= $end & 0x7f; |
|||
} |
|||
print ")\n"; |
|||
} |
|||
substr($page,0,4)=pack("N",0xdeadbeef); |
|||
substr($page,$ps-8,4)=pack("N",0xdeadbeef); |
|||
sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; |
|||
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; |
|||
close(FILE) || die "Unable to close $file\n"; |
|||
EOF |
|||
--source include/start_mysqld.inc |
|||
|
|||
SHOW CREATE TABLE tr; |
|||
INSERT INTO tr VALUES(42); |
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
SHOW CREATE TABLE tc; |
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
SHOW CREATE TABLE td; |
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
SHOW CREATE TABLE tz; |
|||
--error ER_NO_SUCH_TABLE_IN_ENGINE |
|||
SHOW CREATE TABLE tp; |
|||
|
|||
--source include/shutdown_mysqld.inc |
|||
|
|||
let SEARCH_RANGE= -50000; |
|||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; |
|||
--let SEARCH_PATTERN= InnoDB: Table '.test.\..t[cdzp].' in InnoDB data dictionary has unknown type (81|f21|8a1|3023) |
|||
--source include/search_pattern_in_file.inc |
|||
--let SEARCH_PATTERN= InnoDB: Cannot open table test/t[cdzp] from the internal data dictionary of InnoDB |
|||
--source include/search_pattern_in_file.inc |
|||
|
|||
# Restore the backup of the corrupted SYS_TABLES clustered index root page |
|||
--perl |
|||
use strict; |
|||
my $ps= $ENV{INNODB_PAGE_SIZE}; |
|||
my $file= "$ENV{bugdir}/ibdata1"; |
|||
open(FILE, "+<", $file) || die "Unable to open $file\n"; |
|||
open(BACKUP, "<$ENV{bugdir}/sys_tables.bin") || die "Unable to open backup\n"; |
|||
# Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). |
|||
sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; |
|||
die "Unable to read $file\n" unless sysread(FILE, $_, 4) == 4; |
|||
my $sys_tables_root = unpack("N", $_); |
|||
print "Restoring SYS_TABLES clustered index root page ($sys_tables_root)\n"; |
|||
sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; |
|||
die "Unable to read backup\n" unless sysread(BACKUP, $_, $ps) == $ps; |
|||
die "Unable to restore backup\n" unless syswrite(FILE, $_, $ps) == $ps; |
|||
close(BACKUP); |
|||
close(FILE) || die "Unable to close $file\n"; |
|||
EOF |
|||
--source include/start_mysqld.inc |
|||
|
|||
SHOW CREATE TABLE tr; |
|||
SHOW CREATE TABLE tc; |
|||
SHOW CREATE TABLE td; |
|||
SHOW CREATE TABLE tz; |
|||
SHOW CREATE TABLE tp; |
|||
|
|||
BEGIN; |
|||
INSERT INTO tr VALUES(1); |
|||
INSERT INTO tc VALUES(1); |
|||
INSERT INTO td VALUES(1); |
|||
INSERT INTO tz VALUES(1); |
|||
INSERT INTO tp VALUES(1); |
|||
ROLLBACK; |
|||
|
|||
SELECT * FROM tr; |
|||
SELECT * FROM tc; |
|||
SELECT * FROM td; |
|||
SELECT * FROM tz; |
|||
SELECT * FROM tp; |
|||
|
|||
DROP TABLE tr,tc,td,tz,tp; |
|||
|
|||
--source include/shutdown_mysqld.inc |
|||
|
|||
--let $restart_parameters= |
|||
--source include/start_mysqld.inc |
|||
|
|||
--list_files $bugdir |
|||
--remove_files_wildcard $bugdir |
|||
--rmdir $bugdir |
@ -0,0 +1,37 @@ |
|||
set names utf8; |
|||
create database mysqltest1; |
|||
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1'; |
|||
database_name table_name length(table_name) |
|||
CREATE TABLE mysqltest1.test_jfg_table_name_with_64_chars_123456789012345678901234567890 ( |
|||
id int(10) unsigned NOT NULL, |
|||
id2 int(10) unsigned NOT NULL, |
|||
PRIMARY KEY ( id, id2 ) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
PARTITION BY RANGE ( id ) |
|||
SUBPARTITION BY HASH ( id2 ) |
|||
SUBPARTITIONS 2 ( |
|||
PARTITION test_jfg_partition_name_with_60_chars_1234567890123456789012 VALUES LESS THAN (1000) ENGINE = InnoDB, |
|||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB); |
|||
Warnings: |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. |
|||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
|||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT. |
|||
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1'; |
|||
database_name table_name length(table_name) |
|||
CREATE TABLE mysqltest1.éééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé ( |
|||
id int(10) unsigned NOT NULL, |
|||
id2 int(10) unsigned NOT NULL, |
|||
PRIMARY KEY ( id, id2 ) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
PARTITION BY RANGE ( id ) |
|||
SUBPARTITION BY HASH ( id2 ) |
|||
SUBPARTITIONS 2 ( |
|||
PARTITION çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç VALUES LESS THAN (1000) ENGINE = InnoDB, |
|||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB); |
|||
ERROR HY000: The path specified for @0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@0n@ is too long. |
|||
drop database mysqltest1; |
@ -0,0 +1,6 @@ |
|||
set sql_mode=ansi_quotes; |
|||
create table t1 (i int) partition by range (i) (partition flush values less than maxvalue); |
|||
set sql_mode=default; |
|||
lock tables t1 read local; |
|||
unlock tables; |
|||
drop table t1; |
@ -0,0 +1,32 @@ |
|||
source include/have_innodb.inc; |
|||
source include/have_partition.inc; |
|||
set names utf8; |
|||
|
|||
create database mysqltest1; |
|||
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1'; |
|||
CREATE TABLE mysqltest1.test_jfg_table_name_with_64_chars_123456789012345678901234567890 ( |
|||
id int(10) unsigned NOT NULL, |
|||
id2 int(10) unsigned NOT NULL, |
|||
PRIMARY KEY ( id, id2 ) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
PARTITION BY RANGE ( id ) |
|||
SUBPARTITION BY HASH ( id2 ) |
|||
SUBPARTITIONS 2 ( |
|||
PARTITION test_jfg_partition_name_with_60_chars_1234567890123456789012 VALUES LESS THAN (1000) ENGINE = InnoDB, |
|||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB); |
|||
|
|||
select database_name, table_name, length(table_name) from mysql.innodb_table_stats where database_name = 'mysqltest1'; |
|||
|
|||
--error ER_PATH_LENGTH |
|||
CREATE TABLE mysqltest1.éééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééééé ( |
|||
id int(10) unsigned NOT NULL, |
|||
id2 int(10) unsigned NOT NULL, |
|||
PRIMARY KEY ( id, id2 ) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
|||
PARTITION BY RANGE ( id ) |
|||
SUBPARTITION BY HASH ( id2 ) |
|||
SUBPARTITIONS 2 ( |
|||
PARTITION çççççççççççççççççççççççççççççççççççççççççççççççççççççççççççç VALUES LESS THAN (1000) ENGINE = InnoDB, |
|||
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = InnoDB); |
|||
|
|||
drop database mysqltest1; |
@ -0,0 +1,10 @@ |
|||
# |
|||
# MDEV-13017 LOCK TABLE fails with irrelevant error while working with tables affected by ANSI_QUOTES |
|||
# |
|||
--source include/have_partition.inc |
|||
set sql_mode=ansi_quotes; |
|||
create table t1 (i int) partition by range (i) (partition flush values less than maxvalue); |
|||
set sql_mode=default; |
|||
lock tables t1 read local; |
|||
unlock tables; |
|||
drop table t1; |
@ -0,0 +1,103 @@ |
|||
CREATE USER has_role@'localhost'; |
|||
GRANT ALL PRIVILEGES ON *.* TO has_role@'localhost'; |
|||
CREATE ROLE test_role; |
|||
GRANT test_role TO has_role@'localhost'; |
|||
CREATE USER no_role@'localhost'; |
|||
GRANT ALL PRIVILEGES ON *.* TO no_role@'localhost'; |
|||
CREATE TABLE view_role_test ( |
|||
id int primary key, |
|||
role_name varchar(50) |
|||
); |
|||
INSERT INTO view_role_test VALUES (1, 'test_role'); |
|||
# |
|||
# Use the same logic for stored procedures. |
|||
# |
|||
PREPARE prepared_no_current_role FROM "SELECT * from view_role_test WHERE role_name = CURRENT_ROLE()"; |
|||
# |
|||
# Creating a view with no CURRENT_ROLE() set and one with CURRENT_ROLE() |
|||
# set. Both should produce the same SHOW CREATE VIEW output. |
|||
# |
|||
CREATE |
|||
DEFINER = no_role@localhost |
|||
SQL SECURITY INVOKER |
|||
VIEW v_view_role_test_no_current_role |
|||
AS |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
SHOW CREATE VIEW v_view_role_test_no_current_role; |
|||
View Create View character_set_client collation_connection |
|||
v_view_role_test_no_current_role CREATE ALGORITHM=UNDEFINED DEFINER=`no_role`@`localhost` SQL SECURITY INVOKER VIEW `v_view_role_test_no_current_role` AS select `view_role_test`.`id` AS `id`,`view_role_test`.`role_name` AS `role_name` from `view_role_test` where (`view_role_test`.`role_name` = current_role()) latin1 latin1_swedish_ci |
|||
# |
|||
# No values should be returned |
|||
# |
|||
EXECUTE prepared_no_current_role; |
|||
id role_name |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
id role_name |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
id role_name |
|||
# |
|||
# Now let's set the role. Create identical views as before. See if |
|||
# their behaviour is different. It should not be. |
|||
# |
|||
SET ROLE test_role; |
|||
SELECT CURRENT_USER(); |
|||
CURRENT_USER() |
|||
root@localhost |
|||
SELECT CURRENT_ROLE(); |
|||
CURRENT_ROLE() |
|||
test_role |
|||
# |
|||
# Create the VIEW and prepared Statement with a CURRENT_ROLE() set. |
|||
# |
|||
CREATE |
|||
DEFINER = no_role@localhost |
|||
SQL SECURITY INVOKER |
|||
VIEW v_view_role_test_with_current_role |
|||
AS |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
PREPARE prepared_with_current_role FROM "SELECT * from view_role_test WHERE role_name = CURRENT_ROLE()"; |
|||
SHOW CREATE VIEW v_view_role_test_with_current_role; |
|||
View Create View character_set_client collation_connection |
|||
v_view_role_test_with_current_role CREATE ALGORITHM=UNDEFINED DEFINER=`no_role`@`localhost` SQL SECURITY INVOKER VIEW `v_view_role_test_with_current_role` AS select `view_role_test`.`id` AS `id`,`view_role_test`.`role_name` AS `role_name` from `view_role_test` where (`view_role_test`.`role_name` = current_role()) latin1 latin1_swedish_ci |
|||
# |
|||
# Values should be returned for all select statements as we do have |
|||
# a CURRENT_ROLE() active; |
|||
# |
|||
EXECUTE prepared_no_current_role; |
|||
id role_name |
|||
1 test_role |
|||
EXECUTE prepared_with_current_role; |
|||
id role_name |
|||
1 test_role |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
id role_name |
|||
1 test_role |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
id role_name |
|||
1 test_role |
|||
SELECT * FROM v_view_role_test_with_current_role; |
|||
id role_name |
|||
1 test_role |
|||
SET ROLE NONE; |
|||
# |
|||
# No values should be returned for all select statements as we do not have |
|||
# a CURRENT_ROLE() active; |
|||
# |
|||
EXECUTE prepared_no_current_role; |
|||
id role_name |
|||
EXECUTE prepared_with_current_role; |
|||
id role_name |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
id role_name |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
id role_name |
|||
SELECT * FROM v_view_role_test_with_current_role; |
|||
id role_name |
|||
DROP USER has_role@'localhost'; |
|||
DROP USER no_role@'localhost'; |
|||
DROP ROLE test_role; |
|||
DROP table view_role_test; |
|||
DROP VIEW v_view_role_test_no_current_role; |
|||
DROP VIEW v_view_role_test_with_current_role; |
|||
DROP PREPARE prepared_no_current_role; |
|||
DROP PREPARE prepared_with_current_role; |
@ -0,0 +1,102 @@ |
|||
# |
|||
# MDEV-12666 CURRENT_ROLE() does not work in a view |
|||
# |
|||
--source include/not_embedded.inc |
|||
|
|||
CREATE USER has_role@'localhost'; |
|||
GRANT ALL PRIVILEGES ON *.* TO has_role@'localhost'; |
|||
|
|||
CREATE ROLE test_role; |
|||
GRANT test_role TO has_role@'localhost'; |
|||
|
|||
CREATE USER no_role@'localhost'; |
|||
GRANT ALL PRIVILEGES ON *.* TO no_role@'localhost'; |
|||
|
|||
CREATE TABLE view_role_test ( |
|||
id int primary key, |
|||
role_name varchar(50) |
|||
); |
|||
|
|||
INSERT INTO view_role_test VALUES (1, 'test_role'); |
|||
|
|||
--echo # |
|||
--echo # Use the same logic for stored procedures. |
|||
--echo # |
|||
PREPARE prepared_no_current_role FROM "SELECT * from view_role_test WHERE role_name = CURRENT_ROLE()"; |
|||
|
|||
--echo # |
|||
--echo # Creating a view with no CURRENT_ROLE() set and one with CURRENT_ROLE() |
|||
--echo # set. Both should produce the same SHOW CREATE VIEW output. |
|||
--echo # |
|||
CREATE |
|||
DEFINER = no_role@localhost |
|||
SQL SECURITY INVOKER |
|||
VIEW v_view_role_test_no_current_role |
|||
AS |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
|
|||
SHOW CREATE VIEW v_view_role_test_no_current_role; |
|||
|
|||
|
|||
--echo # |
|||
--echo # No values should be returned |
|||
--echo # |
|||
EXECUTE prepared_no_current_role; |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
|
|||
--echo # |
|||
--echo # Now let's set the role. Create identical views as before. See if |
|||
--echo # their behaviour is different. It should not be. |
|||
--echo # |
|||
SET ROLE test_role; |
|||
|
|||
SELECT CURRENT_USER(); |
|||
SELECT CURRENT_ROLE(); |
|||
|
|||
--echo # |
|||
--echo # Create the VIEW and prepared Statement with a CURRENT_ROLE() set. |
|||
--echo # |
|||
CREATE |
|||
DEFINER = no_role@localhost |
|||
SQL SECURITY INVOKER |
|||
VIEW v_view_role_test_with_current_role |
|||
AS |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
|
|||
PREPARE prepared_with_current_role FROM "SELECT * from view_role_test WHERE role_name = CURRENT_ROLE()"; |
|||
|
|||
SHOW CREATE VIEW v_view_role_test_with_current_role; |
|||
|
|||
|
|||
--echo # |
|||
--echo # Values should be returned for all select statements as we do have |
|||
--echo # a CURRENT_ROLE() active; |
|||
--echo # |
|||
EXECUTE prepared_no_current_role; |
|||
EXECUTE prepared_with_current_role; |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
SELECT * FROM v_view_role_test_with_current_role; |
|||
|
|||
SET ROLE NONE; |
|||
--echo # |
|||
--echo # No values should be returned for all select statements as we do not have |
|||
--echo # a CURRENT_ROLE() active; |
|||
--echo # |
|||
EXECUTE prepared_no_current_role; |
|||
EXECUTE prepared_with_current_role; |
|||
SELECT * FROM view_role_test WHERE role_name = CURRENT_ROLE(); |
|||
SELECT * FROM v_view_role_test_no_current_role; |
|||
SELECT * FROM v_view_role_test_with_current_role; |
|||
|
|||
|
|||
DROP USER has_role@'localhost'; |
|||
DROP USER no_role@'localhost'; |
|||
DROP ROLE test_role; |
|||
|
|||
DROP table view_role_test; |
|||
DROP VIEW v_view_role_test_no_current_role; |
|||
DROP VIEW v_view_role_test_with_current_role; |
|||
DROP PREPARE prepared_no_current_role; |
|||
DROP PREPARE prepared_with_current_role; |
@ -0,0 +1,65 @@ |
|||
drop database if exists db; |
|||
Warnings: |
|||
Note 1008 Can't drop database 'db'; database doesn't exist |
|||
create role r1; |
|||
create user beep@'%'; |
|||
create database db; |
|||
create table db.t1 (i int); |
|||
create table db.t2 (b int); |
|||
grant select on db.* to r1; |
|||
grant r1 to beep@'%'; |
|||
show databases; |
|||
Database |
|||
information_schema |
|||
test |
|||
show create database db; |
|||
ERROR 42000: Access denied for user 'beep'@'localhost' to database 'db' |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
table_schema table_name |
|||
set role r1; |
|||
show databases; |
|||
Database |
|||
db |
|||
information_schema |
|||
test |
|||
show create database db; |
|||
Database Create Database |
|||
db CREATE DATABASE `db` /*!40100 DEFAULT CHARACTER SET latin1 */ |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
table_schema table_name |
|||
db t1 |
|||
db t2 |
|||
create role r2; |
|||
create user beep2@'%'; |
|||
grant update on db.* to r2; |
|||
grant r2 to beep2; |
|||
show databases; |
|||
Database |
|||
information_schema |
|||
test |
|||
show create database db; |
|||
ERROR 42000: Access denied for user 'beep2'@'localhost' to database 'db' |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
table_schema table_name |
|||
set role r2; |
|||
show databases; |
|||
Database |
|||
db |
|||
information_schema |
|||
test |
|||
show create database db; |
|||
Database Create Database |
|||
db CREATE DATABASE `db` /*!40100 DEFAULT CHARACTER SET latin1 */ |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
table_schema table_name |
|||
db t1 |
|||
db t2 |
|||
drop database db; |
|||
drop role r1; |
|||
drop user beep; |
|||
drop role r2; |
|||
drop user beep2; |
@ -0,0 +1,55 @@ |
|||
source include/not_embedded.inc; |
|||
|
|||
drop database if exists db; |
|||
|
|||
create role r1; |
|||
create user beep@'%'; |
|||
|
|||
create database db; |
|||
create table db.t1 (i int); |
|||
create table db.t2 (b int); |
|||
grant select on db.* to r1; |
|||
grant r1 to beep@'%'; |
|||
|
|||
--connect (con1,localhost,beep,,) |
|||
show databases; |
|||
--error ER_DBACCESS_DENIED_ERROR |
|||
show create database db; |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
|
|||
set role r1; |
|||
show databases; |
|||
show create database db; |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
|
|||
|
|||
connection default; |
|||
create role r2; |
|||
create user beep2@'%'; |
|||
|
|||
grant update on db.* to r2; |
|||
grant r2 to beep2; |
|||
--connect (con2,localhost,beep2,,) |
|||
show databases; |
|||
--error ER_DBACCESS_DENIED_ERROR |
|||
show create database db; |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
|
|||
set role r2; |
|||
show databases; |
|||
|
|||
show create database db; |
|||
select table_schema, table_name from information_schema.tables |
|||
where table_schema = 'db'; |
|||
|
|||
|
|||
connection default; |
|||
|
|||
drop database db; |
|||
drop role r1; |
|||
drop user beep; |
|||
drop role r2; |
|||
drop user beep2; |
@ -0,0 +1,30 @@ |
|||
include/rpl_init.inc [topology=1->2->1] |
|||
include/rpl_connect.inc [creating M4] |
|||
include/rpl_connect.inc [creating M2] |
|||
SET @old_debug= @@global.debug; |
|||
STOP SLAVE; |
|||
SET GLOBAL debug_dbug= "+d,dbug.rows_events_to_delay_relay_logging"; |
|||
START SLAVE IO_THREAD; |
|||
include/wait_for_slave_io_to_start.inc |
|||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb; |
|||
INSERT INTO `t1` VALUES (null, repeat('a', 1024)), (null, repeat('b', 1024)); |
|||
SET debug_sync='now WAIT_FOR start_sql_thread'; |
|||
START SLAVE SQL_THREAD; |
|||
include/show_binlog_events.inc |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
slave-bin.000001 # Gtid # # GTID #-#-# |
|||
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb |
|||
SET debug_sync='now SIGNAL go_on_relay_logging'; |
|||
include/show_binlog_events.inc |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
slave-bin.000001 # Gtid # # GTID #-#-# |
|||
slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb |
|||
slave-bin.000001 # Gtid # # BEGIN GTID #-#-# |
|||
slave-bin.000001 # Table_map # # table_id: # (test.t1) |
|||
slave-bin.000001 # Write_rows_v1 # # table_id: # |
|||
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F |
|||
slave-bin.000001 # Xid # # COMMIT /* XID */ |
|||
drop table t1; |
|||
SET GLOBAL debug_dbug= @old_debug; |
|||
SET debug_sync='RESET'; |
|||
include/rpl_end.inc |
@ -0,0 +1,29 @@ |
|||
include/master-slave.inc |
|||
[connection master] |
|||
CREATE TABLE t1 (c1 INT); |
|||
INSERT INTO t1 (c1) VALUES (1); |
|||
include/stop_slave_sql.inc |
|||
FLUSH LOGS; |
|||
FLUSH LOGS; |
|||
INSERT INTO t1 (c1) VALUES (2); |
|||
include/sync_slave_io_with_master.inc |
|||
call mtr.add_suppression("File '.*slave-relay-bin."); |
|||
call mtr.add_suppression("Could not open log file"); |
|||
call mtr.add_suppression("Failed to open the relay log"); |
|||
call mtr.add_suppression("Failed to initialize the master info structure"); |
|||
include/rpl_stop_server.inc [server_number=2] |
|||
# Removing file(s) |
|||
include/rpl_start_server.inc [server_number=2] |
|||
START SLAVE; |
|||
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log |
|||
START SLAVE; |
|||
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log |
|||
RESET SLAVE; |
|||
DROP TABLE t1; |
|||
START SLAVE UNTIL MASTER_LOG_FILE= 'MASTER_LOG_FILE', MASTER_LOG_POS= MASTER_LOG_POS;; |
|||
include/wait_for_slave_sql_to_stop.inc |
|||
include/stop_slave_io.inc |
|||
include/start_slave.inc |
|||
include/diff_tables.inc [master:t1, slave:t1] |
|||
DROP TABLE t1; |
|||
include/rpl_end.inc |
@ -0,0 +1,30 @@ |
|||
!include ../my.cnf |
|||
|
|||
[mysqld.1] |
|||
gtid-domain-id=4 |
|||
server-id=4 |
|||
# |
|||
log-slave-updates |
|||
slave-parallel-threads=0 |
|||
gtid-strict-mode=1 |
|||
gtid-ignore-duplicates=1 |
|||
|
|||
# |
|||
# Max-size row events to minimum with the idea to create |
|||
# a number of Rows_log_event per Query. |
|||
# |
|||
binlog-row-event-max-size=1024 |
|||
|
|||
[mysqld.2] |
|||
gtid-domain-id=2 |
|||
server-id=2 |
|||
# |
|||
log-slave-updates |
|||
slave-parallel-threads=0 |
|||
gtid-strict-mode=1 |
|||
gtid-ignore-duplicates=1 |
|||
binlog-row-event-max-size=1024 |
|||
# The slave will be initialized with a @@global.dbug-var value |
|||
skip-slave-start=1 |
|||
|
|||
|
@ -0,0 +1,104 @@ |
|||
# |
|||
# Testing chain/circular replication scenario of MDEV-9670 |
|||
# The effect of the bug was that we got a commit with a GTID with server_id |
|||
# |
|||
|
|||
--source include/have_binlog_format_row.inc |
|||
--source include/have_innodb.inc |
|||
--source include/have_debug.inc |
|||
--source include/have_debug_sync.inc |
|||
|
|||
--let $rpl_topology= 1->2->1 |
|||
--source include/rpl_init.inc |
|||
|
|||
--let $rpl_connection_name= M4 |
|||
--let $rpl_server_number= 1 |
|||
--source include/rpl_connect.inc |
|||
|
|||
--let $rpl_connection_name= M2 |
|||
--let $rpl_server_number= 2 |
|||
--source include/rpl_connect.inc |
|||
|
|||
# The parameter reflects binlog-row-event-max-size @cnf. |
|||
--let $row_size=1024 |
|||
|
|||
SET @old_debug= @@global.debug; |
|||
|
|||
--connection M2 |
|||
STOP SLAVE; |
|||
SET GLOBAL debug_dbug= "+d,dbug.rows_events_to_delay_relay_logging"; |
|||
START SLAVE IO_THREAD; |
|||
--source include/wait_for_slave_io_to_start.inc |
|||
|
|||
--connection M2 |
|||
# This query also creates a Gtid event group whose Gtid will remain in |
|||
# ignored status for too long causing a following group split. |
|||
|
|||
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(30000)) ENGINE=innodb; |
|||
--sync_slave_with_master M4 |
|||
|
|||
# This INSERT will be logged as two Write_log events which the buggy |
|||
# slave applier would split. |
|||
|
|||
--connection M4 |
|||
eval INSERT INTO `t1` VALUES (null, repeat('a', $row_size)), (null, repeat('b', $row_size)); |
|||
|
|||
# START M2 IO thread and wait for its signal to follow with the SQL |
|||
# thread start. At this moment the SQL thread shall be having 2 and |
|||
# "half" groups to execute. The "hafl" one would be committed by the |
|||
# buggy applier after which the IO is released to queue the rest of |
|||
# the 3rd group which the SQL thread commits separately to complete |
|||
# the split. |
|||
|
|||
--connection M2 |
|||
|
|||
# wait for IO signal to start the SQL thread. IO will be hanging upon that. |
|||
SET debug_sync='now WAIT_FOR start_sql_thread'; |
|||
|
|||
# Now the slave server has relay log whose last group is incomplete. |
|||
# An unfixed slave server would go to "insert" a "fake" |
|||
# Gtid_list_log_event event which actually would commit the incomplete |
|||
# group. However before to actual commit do_apply_event() hits some assert. |
|||
# In the fixed server the fake Gtid_list_log_event is *not* inserted |
|||
# in the middle of a group. |
|||
START SLAVE SQL_THREAD; |
|||
|
|||
# Sleep for a little time to give SQL thread a chance to commit while |
|||
# the IO thread is hanging (see |
|||
# DBUG_EXECUTE_IF("dbug.rows_events_to_delay_relay_logging"...) in |
|||
# queue_event). Alternatively to reproduce the case when buggy slave |
|||
# wait for the 1st group commit |
|||
|
|||
#--let $count= 1 |
|||
#--let $table= t1 |
|||
#--source include/wait_until_rows_count.inc |
|||
|
|||
--sleep 2 |
|||
|
|||
# Demonstrate either no split group in the correct slave or the 1nd |
|||
# group in the buggy one |
|||
--source include/show_binlog_events.inc |
|||
|
|||
# Release the IO thread |
|||
SET debug_sync='now SIGNAL go_on_relay_logging'; |
|||
|
|||
# Sync servers |
|||
--sync_slave_with_master M4 |
|||
--connection M4 |
|||
--sync_slave_with_master M2 |
|||
--connection M2 |
|||
|
|||
# Demonstrate replication goes correctly not to create any split, or |
|||
# the 2nd group in the buggy slave |
|||
--source include/show_binlog_events.inc |
|||
|
|||
# |
|||
# Cleanup |
|||
# |
|||
--connection M4 |
|||
drop table t1; |
|||
|
|||
--connection M2 |
|||
SET GLOBAL debug_dbug= @old_debug; |
|||
SET debug_sync='RESET'; |
|||
--source include/rpl_end.inc |
@ -0,0 +1,91 @@ |
|||
############################################################################### |
|||
# Bug#24901077: RESET SLAVE ALL DOES NOT ALWAYS RESET SLAVE |
|||
# |
|||
# Problem: |
|||
# ======= |
|||
# If you have a relay log index file that has ended up with |
|||
# some relay log files that do not exists, then RESET SLAVE |
|||
# ALL is not enough to get back to a clean state. |
|||
############################################################################### |
|||
# Remove all slave-relay-bin.0* files (do not remove slave-relay-bin.index) |
|||
# During server restart rli initialization will fail as there are no |
|||
# relay logs. In case of bug RESET SLAVE will not do the required clean up |
|||
# as rli is not inited and subsequent START SLAVE will fail. |
|||
# Disable "Warning 1612 Being purged log ./slave-relay-bin.0* was not found" |
|||
# because it is different on Unix and Windows systems. |
|||
|
|||
--source include/have_binlog_format_mixed.inc |
|||
--source include/master-slave.inc |
|||
|
|||
--connection master |
|||
CREATE TABLE t1 (c1 INT); |
|||
INSERT INTO t1 (c1) VALUES (1); |
|||
--sync_slave_with_master |
|||
|
|||
--connection slave |
|||
--source include/stop_slave_sql.inc |
|||
--let $MYSQLD_SLAVE_DATADIR= `select @@datadir` |
|||
|
|||
--connection master |
|||
# Generate more relay logs on slave. |
|||
FLUSH LOGS; |
|||
FLUSH LOGS; |
|||
INSERT INTO t1 (c1) VALUES (2); |
|||
|
|||
--source include/sync_slave_io_with_master.inc |
|||
call mtr.add_suppression("File '.*slave-relay-bin."); |
|||
call mtr.add_suppression("Could not open log file"); |
|||
call mtr.add_suppression("Failed to open the relay log"); |
|||
call mtr.add_suppression("Failed to initialize the master info structure"); |
|||
|
|||
# Stop slave |
|||
--let $rpl_server_number= 2 |
|||
--source include/rpl_stop_server.inc |
|||
|
|||
# Delete file(s) |
|||
--echo # Removing $remove_pattern file(s) |
|||
--let $remove_pattern= slave-relay-bin.0* |
|||
--remove_files_wildcard $MYSQLD_SLAVE_DATADIR $remove_pattern |
|||
|
|||
# Start slave |
|||
--let $rpl_server_number= 2 |
|||
--source include/rpl_start_server.inc |
|||
|
|||
# Start slave must fail because of the removed file(s). |
|||
--error ER_MASTER_INFO |
|||
START SLAVE; |
|||
|
|||
# Try a second time, it must fail again. |
|||
--error ER_MASTER_INFO |
|||
START SLAVE; |
|||
|
|||
# Retrieve master executed position before reset slave. |
|||
--let $master_exec_file= query_get_value("SHOW SLAVE STATUS", Relay_Master_Log_File, 1) |
|||
--let $master_exec_pos= query_get_value("SHOW SLAVE STATUS", Exec_Master_Log_Pos, 1) |
|||
|
|||
# Reset slave. |
|||
# Disable "Warning 1612 Being purged log ./slave-relay-bin.0* was not found" |
|||
# because it is different on Unix and Windows systems. |
|||
--disable_warnings |
|||
RESET SLAVE; |
|||
--enable_warnings |
|||
DROP TABLE t1; |
|||
--replace_result $master_exec_file MASTER_LOG_FILE $master_exec_pos MASTER_LOG_POS |
|||
--eval START SLAVE UNTIL MASTER_LOG_FILE= '$master_exec_file', MASTER_LOG_POS= $master_exec_pos; |
|||
--source include/wait_for_slave_sql_to_stop.inc |
|||
--source include/stop_slave_io.inc |
|||
|
|||
# Start slave. |
|||
--source include/start_slave.inc |
|||
|
|||
--connection master |
|||
--sync_slave_with_master |
|||
# Check consistency. |
|||
--let $diff_tables= master:t1, slave:t1 |
|||
--source include/diff_tables.inc |
|||
|
|||
# Cleanup |
|||
--connection master |
|||
DROP TABLE t1; |
|||
--sync_slave_with_master |
|||
--source include/rpl_end.inc |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue