Lars-Erik,
see inline for comments.
On Mi, 2008-11-05 at 12:29 +0000, Lars-Erik.Bjork@stripped wrote:
> #At file:///home/lb200670/devel/mysql/nanna21/
>
> 2901 lars-erik.bjork@stripped 2008-11-05
> This is a commit for bug#40158
> (Falcon assertion in StorageInterface::encodeRecord() line 2635 on CREATE
> TABLE)
>
> The nature of this bug is explained earlier.
>
> This patch adds a bool argument to StorageTableShare::cleanupFieldName
> telling if the function should double the number of quotes or not. So
> far, StorageInterface::mapFields, is the only place this method is
> called, passing 'false'. All other places it is called passing
> 'true'. This will ensure that the parser still gets the expected
> number of quotes and we are able to look up the fields correctly.
>
> I have also added a regression test for this bug, creating - and
> inserting into - a table with a field name containing quotes.
> added:
> mysql-test/suite/falcon/r/falcon_bug_40158.result
> mysql-test/suite/falcon/t/falcon_bug_40158.test
> modified:
> storage/falcon/StorageTableShare.cpp
> storage/falcon/StorageTableShare.h
> storage/falcon/ha_falcon.cpp
[cut]
> === added file 'mysql-test/suite/falcon/t/falcon_bug_40158.test'
> --- a/mysql-test/suite/falcon/t/falcon_bug_40158.test 1970-01-01 00:00:00 +0000
> +++ b/mysql-test/suite/falcon/t/falcon_bug_40158.test 2008-11-05 12:29:45 +0000
> @@ -0,0 +1,46 @@
> +--source include/have_falcon.inc
> +
> +#
> +# Bug #40158: Falcon assertion in StorageInterface::encodeRecord() line 2635 on
> CREATE TABLE
> +#
> +--echo *** Bug #40158 ***
> +
> +# ----------------------------------------------------- #
> +# --- Initialisation --- #
> +# ----------------------------------------------------- #
> +let $engine = 'Falcon';
> +eval SET @@storage_engine = $engine;
> +
> +--disable_warnings
> +DROP TABLE IF EXISTS t1;
> +--enable_warnings
> +
> +# ----------------------------------------------------- #
> +# --- Test --- #
> +# ----------------------------------------------------- #
> +
> +CREATE TABLE t1 (`"strangename"` int) engine=falcon;
Please remove "engine=falcon", it is handled by
eval SET @@storage_engine = $engine;
already.
> +INSERT INTO t1 VALUES (1);
> +SELECT * FROM t1;
> +DROP TABLE t1;
> +
> +SET LOCAL SQL_MODE=ANSI_QUOTES;
> +
> +CREATE TABLE t1 ("""strangename""" int) engine=falcon;
> +INSERT INTO t1 VALUES (1);
> +SELECT * FROM t1;
> +DROP TABLE t1;
> +
> +CREATE TABLE t1 (`""strangename""` int) engine=falcon;
> +INSERT INTO t1 VALUES (1);
> +
> +# ----------------------------------------------------- #
> +# --- Check --- #
> +# ----------------------------------------------------- #
> +
> +SELECT * FROM t1;
> +
Please use SELECT count(*) FROM t1 as final check.
> +# ----------------------------------------------------- #
> +# --- Final cleanup --- #
> +# ----------------------------------------------------- #
> +DROP TABLE t1;
[cut]
Best regards,
Hakan
--
Hakan Küçükyılmaz, Senior Software Engineer DBTG/MySQL +49 160
98953296
Sun Microsystems GmbH Sonnenallee 1, DE-85551 Kirchheim-Heimstetten
Geschaeftsfuehrer: Thomas Schroeder, Wolfang Engels, Dr. Roland Boemer
Vorsitz d. Aufs.rat.: Martin Haering HRB MUC 161028 49.011, 8.376