From a8df3d3c90606b05b7655705517712c2cd418632 Mon Sep 17 00:00:00 2001 From: Narayanan V Date: Sun, 17 May 2009 21:55:23 +0530 Subject: 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 " clause to the CREATE TABLE statement that is passed to DB2. 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 " clause to the CREATE TABLE statement that is passed to DB2. 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 " clause to the CREATE TABLE statement that is passed to DB2. is generated from the original name of the table itself. This ensures a consistent and deterministic mapping from the original table. --- mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test (limited to 'mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_44610.test') 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; -- cgit v1.2.1