--source include/have_falcon.inc
--source include/have_utf8.inc

#
# Bug #<38304>: <Data contents becomes NULL if column name in Falcon table uses accented letters>
#
--echo *** Bug #<38304> ***

# ----------------------------------------------------- #
# --- Initialisation                                --- #
# ----------------------------------------------------- #
let $engine = 'Falcon';
eval SET @@storage_engine = $engine;

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

# ----------------------------------------------------- #
# --- Test                                          --- #
# ----------------------------------------------------- #

SET LOCAL SQL_MODE="";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

DROP TABLE t1;


SET LOCAL SQL_MODE="PIPES_AS_CONCAT,ANSI_QUOTES,ANSI,NO_BACKSLASH_ESCAPES,STRICT_TRANS_TABLES,STRICT_ALL_TABLES";
CREATE TABLE t1 (`äëïôæø` varchar(30) character set utf8);
INSERT INTO t1 VALUES ('this'),('is'), ('a'), ('test');
SELECT * FROM t1;

# ----------------------------------------------------- #
# --- Check                                         --- #
# ----------------------------------------------------- #

SELECT count(*) FROM t1;

# ----------------------------------------------------- #
# --- Final cleanup                                 --- #
# ----------------------------------------------------- #
DROP TABLE t1;
