summaryrefslogtreecommitdiff
path: root/mysql-test/suite/storage_engine/type_char.inc
diff options
context:
space:
mode:
authorElena Stepanova <elenst@ubuntu11.home>2012-07-16 06:17:56 +0400
committerElena Stepanova <elenst@ubuntu11.home>2012-07-16 06:17:56 +0400
commit72a5542f0ef1fbc36aabc511f18855f302906501 (patch)
treefe4cabf5a4e59323b941fb1fa5a300548c841ea2 /mysql-test/suite/storage_engine/type_char.inc
parent403cac0fe710bbd65a65f5b409cff6194ce6bace (diff)
downloadmariadb-git-72a5542f0ef1fbc36aabc511f18855f302906501.tar.gz
MDEV-11: Generic storage engine test suite
Diffstat (limited to 'mysql-test/suite/storage_engine/type_char.inc')
-rw-r--r--mysql-test/suite/storage_engine/type_char.inc59
1 files changed, 59 insertions, 0 deletions
diff --git a/mysql-test/suite/storage_engine/type_char.inc b/mysql-test/suite/storage_engine/type_char.inc
new file mode 100644
index 00000000000..8484fc23b10
--- /dev/null
+++ b/mysql-test/suite/storage_engine/type_char.inc
@@ -0,0 +1,59 @@
+#
+# CHAR column types
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+let $create_definition =
+ c CHAR $col_opts,
+ c0 CHAR(0) $col_opts,
+ c1 CHAR(1) $col_opts,
+ c20 CHAR(20) $col_opts,
+ c255 CHAR(255) $col_opts
+;
+--source create_table.inc
+if ($mysql_errname)
+{
+ --let $my_last_stmt = $create_statement
+ --let $functionality = CHAR types
+ --source unexpected_result.inc
+}
+if (!$mysql_errname)
+{
+ --replace_column 3 # 4 # 5 #
+ SHOW COLUMNS IN t1;
+
+ # Valid values
+
+ INSERT INTO t1 VALUES ('','','','','');
+ INSERT INTO t1 VALUES ('a','','b','abcdefghi klmnopqrst', 'Creating an article for the Knowledgebase is similar to asking questions. First, navigate to the category where you feel the article should be. Once there, double check that an article doesn\'t already exist which would work.');
+
+ --sorted_result
+ SELECT * FROM t1;
+
+ # Invalid values
+
+ INSERT INTO t1 VALUES ('abc', 'a', 'abc', REPEAT('a',21), REPEAT('x',256));
+ INSERT INTO t1 SELECT c255, c255, c255, c255, CONCAT(c255,c1) FROM t1;
+
+ --sorted_result
+ SELECT * FROM t1;
+
+ --sorted_result
+ SELECT DISTINCT c20, REPEAT('a',LENGTH(c20)), COUNT(*) FROM t1 GROUP BY c1, c20;
+
+ --let $error_codes = ER_TOO_BIG_FIELDLENGTH
+ --let $alter_definition = ADD COLUMN c257 CHAR(257) $col_opts
+ --source alter_table.inc
+ if ($mysql_errname != ER_TOO_BIG_FIELDLENGTH)
+ {
+ --let $my_last_stmt = $alter_statement
+ --let $functionality = ALTER TABLE
+ --source unexpected_result.inc
+ }
+ DROP TABLE t1;
+}
+
+