summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-01-18 01:41:52 +0200
committerMonty <monty@mariadb.org>2018-01-18 15:19:32 +0200
commit50de7d13036c7bacbaf460bfcaa77cfbe1ad4123 (patch)
treeaae322b85208f70f5fd792be0ef4b93e1e3f5559 /mysql-test
parentf44017384afa7a10df9866423291fc764046043f (diff)
downloadmariadb-git-50de7d13036c7bacbaf460bfcaa77cfbe1ad4123.tar.gz
Fixed MDEV-14326 engine ARIA with row_format=FIXED is broken
The problem was that max_size was acciently set to 1 in some cases. Other things: - Adjust max_rows if min_rows > max_rows. - Removed not used variable varchar_length - Adjusted max_pack_length (safety fix)
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/maria/max_length.result105
-rw-r--r--mysql-test/suite/maria/max_length.test72
2 files changed, 177 insertions, 0 deletions
diff --git a/mysql-test/suite/maria/max_length.result b/mysql-test/suite/maria/max_length.result
index 049b92eafe5..177810f32a3 100644
--- a/mysql-test/suite/maria/max_length.result
+++ b/mysql-test/suite/maria/max_length.result
@@ -54,3 +54,108 @@ Table Op Msg_type Msg_text
test.t1 check warning Datafile is almost full, 268230656 of 268320768 used
test.t1 check status OK
drop table t1,t2;
+create table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED min_rows=1000000;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 MIN_ROWS=1000000 PAGE_CHECKSUM=1 ROW_FORMAT=FIXED
+insert into t1 select seq,seq from seq_1_to_100000;
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 ROW_FORMAT=FIXED
+insert into t1 select seq,seq from seq_1_to_100000;
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE TRANSACTIONAL=0;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE TRANSACTIONAL=0
+insert into t1 select seq,seq from seq_1_to_100000;
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED MAX_ROWS=10;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=10 PAGE_CHECKSUM=1 ROW_FORMAT=FIXED
+insert into t1 select seq,seq from seq_1_to_100000;
+ERROR HY000: The table 't1' is full
+select count(*) from t1;
+count(*)
+65535
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=DYNAMIC MAX_ROWS=10;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=10 PAGE_CHECKSUM=1 ROW_FORMAT=DYNAMIC
+insert into t1 select seq,seq from seq_1_to_100000;
+ERROR HY000: The table 't1' is full
+select count(*) from t1;
+count(*)
+3276
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 65520 of 65535 used
+test.t1 check status OK
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE MAX_ROWS=10;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=10 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
+insert into t1 select seq,seq from seq_1_to_100000;
+select count(*) from t1;
+count(*)
+100000
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+drop table t1;
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE MAX_ROWS=10;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `c1` int(10) unsigned DEFAULT NULL,
+ `c2` char(80) DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1 MAX_ROWS=10 PAGE_CHECKSUM=1 ROW_FORMAT=PAGE
+insert into t1 select seq,seq from seq_1_to_10000000;
+ERROR HY000: The table 't1' is full
+select count(*) from t1;
+count(*)
+6189940
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check warning Datafile is almost full, 268320768 of 268320768 used
+test.t1 check status OK
+drop table t1;
diff --git a/mysql-test/suite/maria/max_length.test b/mysql-test/suite/maria/max_length.test
index 68ad1e22aa9..2be3da8e1b0 100644
--- a/mysql-test/suite/maria/max_length.test
+++ b/mysql-test/suite/maria/max_length.test
@@ -2,6 +2,7 @@
# This test will use around 1.3G of disk space!
--source include/have_maria.inc
+--source include/have_sequence.inc
--source include/big_test.inc
drop table if exists t1,t2;
@@ -50,3 +51,74 @@ insert into t1 (v,b) select v,b from t2;
check table t1;
drop table t1,t2;
+
+#
+# Check that we don't get table-is-full
+#
+
+create table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED min_rows=1000000;
+show create table t1;
+insert into t1 select seq,seq from seq_1_to_100000;
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED;
+show create table t1;
+insert into t1 select seq,seq from seq_1_to_100000;
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE TRANSACTIONAL=0;
+show create table t1;
+insert into t1 select seq,seq from seq_1_to_100000;
+
+#
+# For these we should get table is full error
+#
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=FIXED MAX_ROWS=10;
+show create table t1;
+--error ER_RECORD_FILE_FULL
+insert into t1 select seq,seq from seq_1_to_100000;
+select count(*) from t1;
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=DYNAMIC MAX_ROWS=10;
+show create table t1;
+--error ER_RECORD_FILE_FULL
+insert into t1 select seq,seq from seq_1_to_100000;
+select count(*) from t1;
+check table t1;
+
+# PAGE uses 3 byte pointers as minimum, which can handle up to 200M files
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE MAX_ROWS=10;
+show create table t1;
+insert into t1 select seq,seq from seq_1_to_100000;
+select count(*) from t1;
+check table t1;
+drop table t1;
+
+create or replace table t1 (
+c1 int unsigned,
+c2 char(80)
+) Engine=ARIA ROW_FORMAT=PAGE MAX_ROWS=10;
+show create table t1;
+--error ER_RECORD_FILE_FULL
+insert into t1 select seq,seq from seq_1_to_10000000;
+select count(*) from t1;
+check table t1;
+drop table t1;