diff options
author | Michael Widenius <monty@mariadb.org> | 2016-06-29 09:14:22 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-06-30 11:43:02 +0200 |
commit | db7edfed17efe6bc3684b0fbacc0b0249e4f0fa2 (patch) | |
tree | f1f484057487a73d32f379a5fdaacd53bfa27b5e /storage/tokudb | |
parent | 23d03a1b1e486da353f20964a1b91068bec209c0 (diff) | |
download | mariadb-git-db7edfed17efe6bc3684b0fbacc0b0249e4f0fa2.tar.gz |
MDEV-7563 Support CHECK constraint as in (or close to) SQL Standard
MDEV-10134 Add full support for DEFAULT
- Added support for using tables with MySQL 5.7 virtual fields,
including MySQL 5.7 syntax
- Better error messages also for old cases
- CREATE ... SELECT now also updates timestamp columns
- Blob can now have default values
- Added new system variable "check_constraint_checks", to turn of
CHECK constraint checking if needed.
- Removed some engine independent tests in suite vcol to only test myisam
- Moved some tests from 'include' to 't'. Should some day be done for all tests.
- FRM version increased to 11 if one uses virtual fields or constraints
- Changed to use a bitmap to check if a field has got a value, instead of
setting HAS_EXPLICIT_VALUE bit in field flags
- Expressions can now be up to 65K in total
- Ensure we are not refering to uninitialized fields when handling virtual fields or defaults
- Changed check_vcol_func_processor() to return a bitmap of used types
- Had to change some functions that calculated cached value in fix_fields to do
this in val() or getdate() instead.
- store_now_in_TIME() now takes a THD argument
- fill_record() now updates default values
- Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL
- Automatically generate a name for constraints that doesn't have a name
- Added support for ALTER TABLE DROP CONSTRAINT
- Ensure that partition functions register virtual fields used. This fixes
some bugs when using virtual fields in a partitioning function
Diffstat (limited to 'storage/tokudb')
4 files changed, 12 insertions, 26 deletions
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result index b5d9ecbedae..3f3f59c7620 100644 --- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result +++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result @@ -643,7 +643,7 @@ c1 c3 hex(c4) c5 c6 ************ connection slave; include/wait_for_slave_sql_error.inc [errno=1091] -Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' +Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that constraint/column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'' STOP SLAVE; RESET SLAVE; diff --git a/storage/tokudb/mysql-test/tokudb/r/type_blob.result b/storage/tokudb/mysql-test/tokudb/r/type_blob.result index 4a3b7206a62..1350bc03045 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_blob.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_blob.result @@ -38,9 +38,9 @@ ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT CREATE TABLE t2 (a char(256)); ERROR 42000: Column length too big for column 'a' (max = 255); use BLOB or TEXT instead CREATE TABLE t1 (a varchar(70000) default "hello"); -ERROR 42000: Column length too big for column 'a' (max = 65535); use BLOB or TEXT instead +Warnings: +Note 1246 Converting column 'a' from VARCHAR to TEXT CREATE TABLE t2 (a blob default "hello"); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value drop table if exists t1,t2; create table t1 (nr int(5) not null auto_increment,b blob,str char(10), primary key (nr)); insert into t1 values (null,"a","A"); @@ -502,11 +502,7 @@ foobar boggle fish 10 drop table t1; create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'imagem' can't have a default value insert into t1 (id) values (1); -Warnings: -Warning 1364 Field 'imagem' doesn't have a default value select charset(load_file('../../std_data/words.dat')), collation(load_file('../../std_data/words.dat')), @@ -776,21 +772,19 @@ NULL 620000000000 drop table t1; create table t1 (a text default ''); -Warnings: -Warning 1101 BLOB/TEXT column 'a' can't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` text DEFAULT NULL + `a` text DEFAULT '' ) ENGINE=ENGINE DEFAULT CHARSET=latin1 insert into t1 values (default); select * from t1; a -NULL + drop table t1; set @@sql_mode='TRADITIONAL'; create table t1 (a text default ''); -ERROR 42000: BLOB/TEXT column 'a' can't have a default value +drop table t1; set @@sql_mode=''; CREATE TABLE t (c TEXT CHARSET ASCII); INSERT INTO t (c) VALUES (REPEAT('1',65537)); diff --git a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result index dd9451fd101..23dc139d410 100644 --- a/storage/tokudb/mysql-test/tokudb/r/type_ranges.result +++ b/storage/tokudb/mysql-test/tokudb/r/type_ranges.result @@ -39,9 +39,6 @@ KEY (ulong), KEY (ulonglong,ulong), KEY (options,flags) ); -Warnings: -Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value -Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment auto int(5) unsigned NULL NO PRI NULL auto_increment # @@ -64,8 +61,8 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # blob_col blob NULL YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # -longblob_col longblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # +longblob_col longblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # show keys from t1; @@ -130,9 +127,6 @@ Warning 1264 Out of range value for column 'ushort' at row 1 Warning 1264 Out of range value for column 'umedium' at row 1 Warning 1265 Data truncated for column 'options' at row 1 insert into t1 (tiny) values (1); -Warnings: -Warning 1364 Field 'mediumblob_col' doesn't have a default value -Warning 1364 Field 'longblob_col' doesn't have a default value select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,utiny,ushort,umedium,ulong,ulonglong,mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000),date_field,time_field,date_time,blob_col,tinyblob_col,mediumblob_col,longblob_col from t1; auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 @@ -239,7 +233,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO MUL NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # @@ -265,7 +259,7 @@ time_field time NULL YES NULL # date_time datetime NULL YES NULL # new_blob_col varchar(20) latin1_swedish_ci YES NULL # tinyblob_col tinyblob NULL YES NULL # -mediumblob_col mediumblob NULL NO NULL # +mediumblob_col mediumblob NULL NO '' # options enum('one','two','tree') latin1_swedish_ci NO NULL # flags set('one','two','tree') latin1_swedish_ci NO # new_field char(10) latin1_swedish_ci NO new # diff --git a/storage/tokudb/mysql-test/tokudb/t/type_blob.test b/storage/tokudb/mysql-test/tokudb/t/type_blob.test index c1055adbe7a..6a429c46a55 100644 --- a/storage/tokudb/mysql-test/tokudb/t/type_blob.test +++ b/storage/tokudb/mysql-test/tokudb/t/type_blob.test @@ -37,9 +37,7 @@ drop table t1,t2,t3,t4; CREATE TABLE t1 (a char(257) default "hello"); --error 1074 CREATE TABLE t2 (a char(256)); ---error 1074 CREATE TABLE t1 (a varchar(70000) default "hello"); ---error 1101 CREATE TABLE t2 (a blob default "hello"); # Safety to be able to continue with other tests if above fails @@ -439,8 +437,8 @@ insert into t1 values (default); select * from t1; drop table t1; set @@sql_mode='TRADITIONAL'; ---error ER_BLOB_CANT_HAVE_DEFAULT create table t1 (a text default ''); +drop table t1; set @@sql_mode=''; # @@ -541,7 +539,7 @@ CREATE TABLE b15776 (a year(-2)); # We've already tested the case, but this should visually show that -# widths that are too large to be interpreted cause DISPLAYWIDTH errors. +# widths that are too large to be interpreted cause errors. --error ER_TOO_BIG_DISPLAYWIDTH CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999)); --error ER_TOO_BIG_FIELDLENGTH |