summaryrefslogtreecommitdiff
path: root/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
diff options
context:
space:
mode:
authorNarayanan V <v.narayanan@sun.com>2009-05-17 21:55:23 +0530
committerNarayanan V <v.narayanan@sun.com>2009-05-17 21:55:23 +0530
commita8df3d3c90606b05b7655705517712c2cd418632 (patch)
tree02814e8ed92b57f11f9abeb31ff3b5146803b035 /mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
parent992247683829a76334b575e3e90cda453486cbd6 (diff)
downloadmariadb-git-a8df3d3c90606b05b7655705517712c2cd418632.tar.gz
Bug#44610 RCDFMT clause requested when creating DB2 table
In order to better support the usage of IBMDB2I tables from within RPG programs, the storage engine should ensure that the RCDFMT name is consistent and predictable for DB2 tables. This patch appends a "RCDFMT <name>" clause to the CREATE TABLE statement that is passed to DB2. <name> is generated from the original name of the table itself. This ensures a consistent and deterministic mapping from the original table. For the sake of simplicity only the alpha-numeric characters are preserved when generating the new name, and these are upper-cased; other characters are replaced with an underscore (_). Following DB2 system identifier rules, the name always begins with an alpha-character and has a maximum of ten characters. If no usable characters are found in the table name, the name X is used. mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_44610.result: Bug#44610 RCDFMT clause requested when creating DB2 table Result file for the test case. mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test: Bug#44610 RCDFMT clause requested when creating DB2 table Test case that confirms that the names that are being generated are valid. storage/ibmdb2i/ha_ibmdb2i.cc: Bug#44610 RCDFMT clause requested when creating DB2 table This patch appends a "RCDFMT <name>" clause to the CREATE TABLE statement that is passed to DB2. <name> is generated from the original name of the table itself. This ensures a consistent and deterministic mapping from the original table. storage/ibmdb2i/ha_ibmdb2i.h: Bug#44610 RCDFMT clause requested when creating DB2 table This patch appends a "RCDFMT <name>" clause to the CREATE TABLE statement that is passed to DB2. <name> is generated from the original name of the table itself. This ensures a consistent and deterministic mapping from the original table.
Diffstat (limited to 'mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test')
-rwxr-xr-xmysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
new file mode 100755
index 00000000000..da69b5d9148
--- /dev/null
+++ b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test
@@ -0,0 +1,28 @@
+source suite/ibmdb2i/include/have_ibmdb2i.inc;
+
+# Test RCDFMT generation for a variety of kinds of table names
+create table ABC (i int) engine=ibmdb2i;
+drop table ABC;
+
+create table `1234567890ABC` (i int) engine=ibmdb2i;
+drop table `1234567890ABC`;
+
+create table `!@#$%` (i int) engine=ibmdb2i;
+drop table `!@#$%`;
+
+create table `ABCD#########` (i int) engine=ibmdb2i;
+drop table `ABCD#########`;
+
+create table `_` (i int) engine=ibmdb2i;
+drop table `_`;
+
+create table `abc##def` (i int) engine=ibmdb2i;
+drop table `abc##def`;
+
+set names utf8;
+create table İ (s1 int) engine=ibmdb2i;
+drop table İ;
+
+create table İİ (s1 int) engine=ibmdb2i;
+drop table İİ;
+set names latin1;