summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-04-01 22:45:32 +0200
committerSergei Golubchik <serg@mariadb.org>2016-12-12 20:44:45 +0100
commit9d7c3cbe18baaa79462870025fc3e7ebf80861f2 (patch)
treed03741eb873b3caafe70b8ede80ffbda3ff152fd
parent5d5e83277f6174e7daf8e495ed08551197aca76f (diff)
downloadmariadb-git-9d7c3cbe18baaa79462870025fc3e7ebf80861f2.tar.gz
CONNECT: simple vcol test
-rw-r--r--storage/connect/mysql-test/connect/r/vcol.result29
-rw-r--r--storage/connect/mysql-test/connect/t/vcol.test26
2 files changed, 55 insertions, 0 deletions
diff --git a/storage/connect/mysql-test/connect/r/vcol.result b/storage/connect/mysql-test/connect/r/vcol.result
new file mode 100644
index 00000000000..1e3ecf8450a
--- /dev/null
+++ b/storage/connect/mysql-test/connect/r/vcol.result
@@ -0,0 +1,29 @@
+create table t1 (
+#linenum int(6) not null default 0 special=rowid,
+name char(12) not null,
+city char(11) not null,
+birth date not null date_format='DD/MM/YYYY',
+hired date not null date_format='DD/MM/YYYY' flag=36,
+agehired int(3) as (floor(datediff(hired,birth)/365.25))
+)
+engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47;
+select * from t1;
+name city birth hired agehired
+John Boston 1986-01-25 2010-06-02 24
+Henry Boston 1987-06-07 2008-04-01 20
+George San Jose 1981-08-10 2010-06-02 28
+Sam Chicago 1979-11-22 2007-10-10 27
+James Dallas 1992-05-13 2009-12-14 17
+Bill Boston 1986-09-11 2008-02-10 21
+drop table t1;
+create table t1 (
+#linenum int(6) not null default 0 special=rowid,
+name char(12) not null,
+city char(11) not null,
+birth date not null date_format='DD/MM/YYYY',
+hired date not null date_format='DD/MM/YYYY' flag=36,
+agehired int(3) as (floor(datediff(hired,birth)/365.25)),
+index (agehired)
+)
+engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47;
+ERROR 42000: Table handler doesn't support NULL in given index. Please change column 'agehired' to be NOT NULL or use another handler
diff --git a/storage/connect/mysql-test/connect/t/vcol.test b/storage/connect/mysql-test/connect/t/vcol.test
new file mode 100644
index 00000000000..0ed13c0e340
--- /dev/null
+++ b/storage/connect/mysql-test/connect/t/vcol.test
@@ -0,0 +1,26 @@
+let datadir= `select @@datadir`;
+--copy_file $MTR_SUITE_DIR/std_data/boys.txt $datadir/test/boys.txt
+
+create table t1 (
+ #linenum int(6) not null default 0 special=rowid,
+ name char(12) not null,
+ city char(11) not null,
+ birth date not null date_format='DD/MM/YYYY',
+ hired date not null date_format='DD/MM/YYYY' flag=36,
+ agehired int(3) as (floor(datediff(hired,birth)/365.25))
+ )
+engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47;
+select * from t1;
+drop table t1;
+
+--error ER_NULL_COLUMN_IN_INDEX
+create table t1 (
+ #linenum int(6) not null default 0 special=rowid,
+ name char(12) not null,
+ city char(11) not null,
+ birth date not null date_format='DD/MM/YYYY',
+ hired date not null date_format='DD/MM/YYYY' flag=36,
+ agehired int(3) as (floor(datediff(hired,birth)/365.25)),
+ index (agehired)
+ )
+engine=CONNECT table_type=FIX file_name='boys.txt' mapped=YES lrecl=47;