summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2013-08-01 11:46:11 +0300
committerunknown <sanja@montyprogram.com>2013-08-01 11:46:11 +0300
commit04fd2f18cb9de58d62ec6c860f586b9f81a95300 (patch)
tree78c0b6c58d67e2f3d69c799c9d56e0eec8e179f1 /mysql-test
parente9db0da787996c1244f579bbc313c82ecde95d2f (diff)
downloadmariadb-git-04fd2f18cb9de58d62ec6c860f586b9f81a95300.tar.gz
MDEV-4811 Assertion `offset < 0x1f' fails in type_and_offset_store on COLUMN_ADD
MDEV-4812 Valgrind warnings (Invalid write) in dynamic_column_update_many on COLUMN_ADD Fixed problem of working on wrong data (do not allow offset to out of string length).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/dyncol.result21
-rw-r--r--mysql-test/t/dyncol.test23
2 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/dyncol.result b/mysql-test/r/dyncol.result
index 6b1dd4d96ec..1b06bd06162 100644
--- a/mysql-test/r/dyncol.result
+++ b/mysql-test/r/dyncol.result
@@ -1404,5 +1404,26 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
drop view v1;
drop table t1;
#
+# MDEV-4811: Assertion `offset < 0x1f' fails in type_and_offset_store
+# on COLUMN_ADD
+#
+CREATE TABLE t1 (dyn TINYBLOB) ENGINE=MyISAM;
+INSERT INTO t1 SET dyn = COLUMN_CREATE( 40, REPEAT('a', 233), 4, REPEAT('b', 322) );
+Warnings:
+Warning 1265 Data truncated for column 'dyn' at row 1
+SELECT COLUMN_ADD( dyn, 6, REPEAT('x',80), 4, REPEAT('y',215) AS INTEGER ) FROM t1;
+ERROR HY000: Encountered illegal format of dynamic column string
+DROP table t1;
+#
+# MDEV-4812: Valgrind warnings (Invalid write) in
+# dynamic_column_update_many on COLUMN_ADD
+#
+CREATE TABLE t1 (dyncol TINYBLOB) ENGINE=MyISAM;
+INSERT INTO t1 SET dyncol = COLUMN_CREATE( 7, REPEAT('k',487), 209, REPEAT('x',464) );
+Warnings:
+Warning 1265 Data truncated for column 'dyncol' at row 1
+SELECT COLUMN_ADD( dyncol, 7, '22:22:22', 8, REPEAT('x',270) AS CHAR ) FROM t1;
+DROP table t1;
+#
# end of 5.3 tests
#
diff --git a/mysql-test/t/dyncol.test b/mysql-test/t/dyncol.test
index ca3ff600509..914bf9151b3 100644
--- a/mysql-test/t/dyncol.test
+++ b/mysql-test/t/dyncol.test
@@ -600,6 +600,29 @@ drop view v1;
drop table t1;
--echo #
+--echo # MDEV-4811: Assertion `offset < 0x1f' fails in type_and_offset_store
+--echo # on COLUMN_ADD
+--echo #
+
+CREATE TABLE t1 (dyn TINYBLOB) ENGINE=MyISAM;
+INSERT INTO t1 SET dyn = COLUMN_CREATE( 40, REPEAT('a', 233), 4, REPEAT('b', 322) );
+--error ER_DYN_COL_WRONG_FORMAT
+SELECT COLUMN_ADD( dyn, 6, REPEAT('x',80), 4, REPEAT('y',215) AS INTEGER ) FROM t1;
+
+DROP table t1;
+
+--echo #
+--echo # MDEV-4812: Valgrind warnings (Invalid write) in
+--echo # dynamic_column_update_many on COLUMN_ADD
+--echo #
+CREATE TABLE t1 (dyncol TINYBLOB) ENGINE=MyISAM;
+
+INSERT INTO t1 SET dyncol = COLUMN_CREATE( 7, REPEAT('k',487), 209, REPEAT('x',464) );
+--error 0,ER_DYN_COL_WRONG_FORMAT
+SELECT COLUMN_ADD( dyncol, 7, '22:22:22', 8, REPEAT('x',270) AS CHAR ) FROM t1;
+DROP table t1;
+
+--echo #
--echo # end of 5.3 tests
--echo #