Commit graph

71 commits

Author SHA1 Message Date
Alexander Barkov
6cb4731fdf More test for MDEV-10134 Add full support for DEFAULT
- INT result functions
- CAST variants: COLLATE, BINARY, CONVERT(..USING)
2016-06-30 11:43:02 +02:00
Alexander Barkov
582ee3973e More tests for MDEV-10134 Add full support for DEFAULT
Numeric functions with string input
2016-06-30 11:43:02 +02:00
Alexander Barkov
f9fb646b16 More tests for MDEV-10134 Add full support for DEFAULT
Boolean predicates
2016-06-30 11:43:02 +02:00
Alexander Barkov
11ff9014b1 More tests for MDEV-7563 Support CHECK constraint
Adding tests for cast, bit functions, string functions.
2016-06-30 11:43:02 +02:00
Alexander Barkov
11debf698f Adding more tests for "MDEV-7563 Support CHECK constraint":
- real functions
- temporal functions
- hybrid functions
2016-06-30 11:43:02 +02:00
Michael Widenius
db7edfed17 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
2016-06-30 11:43:02 +02:00
Michael Widenius
6c173324ff Part of MDEV-10134 Add full support for DEFAULT
Print default values for BLOB's.
This is a part commit for automatic changes to make the real commit smaller.
All changes here are related to that we now print DEFAULT NULL for blob and
text fields, like we do for all other fields.
2016-06-30 11:43:02 +02:00
Oleksandr Byelkin
e3982cead2 MDEV-6066: Merge new defaults from 5.6 and 5.7 (defaults changed, QC can be stopped with no-zero size) 2015-09-04 10:33:56 +02:00
Alexander Barkov
9090c3efca Adding a test for Item_default_value in WHERE condition:
WHERE DEFAULT(col)
It seems this was not covered yet.
2015-05-04 18:31:24 +04:00
Sergey Glukhov
4b260b668d Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
Table corruption happens during table reading in ha_tina::find_current_row() func.
Field::store() method returns error(true) if stored value is 0.
The fix:
added special case for enum type which correctly processes 0 value.
Additional fix:
INSERT...(default) and INSERT...() have the same behaviour now for enum type.


mysql-test/r/csv.result:
  test result
mysql-test/r/default.result:
  result fix
mysql-test/t/csv.test:
  test case
sql/item.cc:
  Changes:
  do not print warning for 'enum' type if there is no default value.
  set default value.
storage/csv/ha_tina.cc:
  Table corruption happens during table reading in ha_tina::find_current_row() func.
  Field::store() method returns error(true) if stored value is 0.
  The fix:
  added special case for enum type which correctly processes 0 value.
2010-02-17 16:13:42 +04:00
Gleb Shchepa
5cee5b9b96 merge 5.0 --> 5.1 2008-09-03 13:06:03 +05:00
Gleb Shchepa
59b9d50c8a Bug #39002: The server crashes on the query:
INSERT .. SELECT .. ON DUPLICATE KEY UPDATE col=DEFAULT

In order to get correct values from update fields that
belongs to the SELECT part in the INSERT .. SELECT .. ON
DUPLICATE KEY UPDATE statement, the server adds referenced
fields to the select list. Part of the code that does this
transformation is shared between implementations of
the DEFAULT(col) function and the DEFAULT keyword (in
the col=DEFAULT expression), and an implementation of
the DEFAULT keyword is incomplete.


mysql-test/r/default.result:
  Added test case for bug #39002.
mysql-test/t/default.test:
  Added test case for bug #39002.
sql/item.cc:
  The Item_default_value::transform() function has been
  modified to take into account the fact that the DEFAULT
  keyword has no arguments unlike the DEFAULT(col) function
  that always has an argument.
2008-09-03 12:32:43 +05:00
unknown
d0f7942474 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/ctype_collate.result:
  Auto merged
mysql-test/r/ctype_recoding.result:
  Auto merged
mysql-test/r/default.result:
  Auto merged
mysql-test/r/gis.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/key.result:
  Auto merged
mysql-test/r/mysql.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/type_enum.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/r/show_check.result:
  manual merge
mysql-test/t/information_schema.test:
  manual merge
sql/sql_show.cc:
  manual merge
2007-09-20 14:10:05 +05:00
unknown
fac190a28b Bug#27747 database metadata doesn't return sufficient column default info
added get_field_default_value() function which obtains default value from the field
(used in store_create_info() & get_schema_column_record() functions)


mysql-test/r/alter_table.result:
  result fix
mysql-test/r/create.result:
  result fix
mysql-test/r/ctype_collate.result:
  result fix
mysql-test/r/ctype_recoding.result:
  result fix
mysql-test/r/default.result:
  result fix
mysql-test/r/gis.result:
  result fix
mysql-test/r/grant.result:
  result fix
mysql-test/r/information_schema.result:
  result fix
mysql-test/r/key.result:
  result fix
mysql-test/r/mysql.result:
  result fix
mysql-test/r/ps_1general.result:
  result fix
mysql-test/r/show_check.result:
  result fix
mysql-test/r/sp.result:
  result fix
mysql-test/r/type_enum.result:
  result fix
mysql-test/r/type_ranges.result:
  result fix
mysql-test/t/information_schema.test:
  test case
2007-09-20 13:54:46 +05:00
unknown
d30e1c76ae Merge mysql.com:/home/hf/work/20691/my50-20691
into  mysql.com:/home/hf/work/20691/my51-20691


mysql-test/r/default.result:
  Auto merged
sql/item.cc:
  Auto merged
mysql-test/r/gis.result:
  SCCS merged
mysql-test/t/gis.test:
  merging
2007-02-13 01:22:43 +04:00
unknown
07f36668ae bug #20691 (INSERT (DEFAULT) may insert garbage with NO DEFAULT NOT NULL field)
Some fields (GEOMETRY first of all) can't be handled properly in this
case at all. So we return an error in this case


mysql-test/r/default.result:
  result fixed
mysql-test/r/gis.result:
  result fixed
mysql-test/t/default.test:
  VIEW test added
mysql-test/t/gis.test:
  testcase added
sql/item.cc:
  set_defaults() changed with the 'reset()'
2007-02-12 15:41:36 +04:00
unknown
9e2e4f7dd2 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug20691/my50-bug20691
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug20691/my51-bug20691


mysql-test/r/default.result:
  Auto merged
sql/item.cc:
  Auto merged
2006-11-10 14:48:07 -05:00
unknown
19d61b1b81 Bug#20691: DATETIME col (NOT NULL, NO DEFAULT) may insert garbage when \
specifying DEFAULT

This was not specific to datetime.  When there is no default value 
for a column, and the user inserted DEFAULT, we would write 
uninitialized memory to the table.  

Now, insist on writing a default value, a zero-ish value, the same 
one that comes from inserting NULL into a not-NULL field.

(This is, at best, really strange behavior that comes from allowing 
sloppy usage, and serves as a good reason always to run one's server 
in a strict SQL mode.)


mysql-test/r/default.result:
  Verify that all kinds of types work, even others other than datetime.
mysql-test/t/default.test:
  Verify that all kinds of types work, even others other than datetime.
sql/item.cc:
  Even if we warn that there is no default value in the table definition,
  we have to insert /something/.
2006-11-09 18:33:58 -05:00
unknown
31a7a0d646 Bug#10460 SHOW CREATE TABLE uses inconsistent upper/lower case
mysql-test/r/alter_table.result:
  Update test result
mysql-test/r/analyse.result:
  Update test result
mysql-test/r/archive.result:
  Update test result
mysql-test/r/archive_bitfield.result:
  Update test result
mysql-test/r/archive_gis.result:
  Update test result
mysql-test/r/bdb.result:
  Update test result
mysql-test/r/bdb_gis.result:
  Update test result
mysql-test/r/bigint.result:
  Update test result
mysql-test/r/binary.result:
  Update test result
mysql-test/r/case.result:
  Update test result
mysql-test/r/cast.result:
  Update test result
mysql-test/r/constraints.result:
  Update test result
mysql-test/r/create.result:
  Update test result
mysql-test/r/ctype_collate.result:
  Update test result
mysql-test/r/ctype_create.result:
  Update test result
mysql-test/r/ctype_latin1_de.result:
  Update test result
mysql-test/r/ctype_many.result:
  Update test result
mysql-test/r/ctype_mb.result:
  Update test result
mysql-test/r/ctype_recoding.result:
  Update test result
mysql-test/r/ctype_sjis.result:
  Update test result
mysql-test/r/ctype_tis620.result:
  Update test result
mysql-test/r/ctype_ucs.result:
  Update test result
mysql-test/r/ctype_ujis.result:
  Update test result
mysql-test/r/ctype_utf8.result:
  Update test result
mysql-test/r/default.result:
  Update test result
mysql-test/r/events.result:
  Update test result
mysql-test/r/federated.result:
  Update test result
mysql-test/r/fulltext.result:
  Update test result
mysql-test/r/func_gconcat.result:
  Update test result
mysql-test/r/func_group.result:
  Update test result
mysql-test/r/func_math.result:
  Update test result
mysql-test/r/func_misc.result:
  Update test result
mysql-test/r/func_str.result:
  Update test result
mysql-test/r/func_system.result:
  Update test result
mysql-test/r/gis-rtree.result:
  Update test result
mysql-test/r/heap.result:
  Update test result
mysql-test/r/index_merge_innodb.result:
  Update test result
mysql-test/r/information_schema.result:
  Update test result
mysql-test/r/innodb.result:
  Update test result
mysql-test/r/innodb_gis.result:
  Update test result
mysql-test/r/key.result:
  Update test result
mysql-test/r/merge.result:
  Update test result
mysql-test/r/myisam.result:
  Update test result
mysql-test/r/mysqldump-max.result:
  Update test result
mysql-test/r/mysqldump.result:
  Update test result
mysql-test/r/ndb_bitfield.result:
  Update test result
mysql-test/r/ndb_gis.result:
  Update test result
mysql-test/r/ndb_partition_key.result:
  Update test result
mysql-test/r/null.result:
  Update test result
mysql-test/r/partition.result:
  Update test result
mysql-test/r/partition_02myisam.result:
  Update test result
mysql-test/r/partition_mgm_err.result:
  Update test result
mysql-test/r/partition_range.result:
  Update test result
mysql-test/r/ps_2myisam.result:
  Update test result
mysql-test/r/ps_3innodb.result:
  Update test result
mysql-test/r/ps_4heap.result:
  Update test result
mysql-test/r/ps_5merge.result:
  Update test result
mysql-test/r/ps_6bdb.result:
  Update test result
mysql-test/r/rpl_mixed_ddl_dml.result:
  Update test result
mysql-test/r/rpl_multi_engine.result:
  Update test result
mysql-test/r/rpl_ndb_UUID.result:
  Update test result
mysql-test/r/show_check.result:
  Update test result
mysql-test/r/sp-vars.result:
  Update test result
mysql-test/r/sp.result:
  Update test result
mysql-test/r/sql_mode.result:
  Update test result
mysql-test/r/strict.result:
  Update test result
mysql-test/r/subselect.result:
  Update test result
mysql-test/r/symlink.result:
  Update test result
mysql-test/r/synchronization.result:
  Update test result
mysql-test/r/system_mysql_db.result:
  Update test result
mysql-test/r/temp_table.result:
  Update test result
mysql-test/r/trigger.result:
  Update test result
mysql-test/r/type_binary.result:
  Update test result
mysql-test/r/type_bit.result:
  Update test result
mysql-test/r/type_bit_innodb.result:
  Update test result
mysql-test/r/type_blob.result:
  Update test result
mysql-test/r/type_decimal.result:
  Update test result
mysql-test/r/type_enum.result:
  Update test result
mysql-test/r/type_float.result:
  Update test result
mysql-test/r/type_nchar.result:
  Update test result
mysql-test/r/type_newdecimal.result:
  Update test result
mysql-test/r/type_set.result:
  Update test result
mysql-test/r/type_timestamp.result:
  Update test result
mysql-test/r/type_varchar.result:
  Update test result
mysql-test/r/union.result:
  Update test result
mysql-test/r/user_var.result:
  Update test result
mysql-test/r/variables.result:
  Update test result
sql/sql_show.cc:
  Make ouput from SHOW CREATE TABLE use uppercase for "CHARACTER SET", "COLLATE", "DEFAULT", "ON UPDATE" and "AUTO_INCREMENT"
2006-02-22 10:09:59 +01:00
unknown
cbad9e2c69 test case fixed to pass w/o innodb 2005-09-25 15:44:05 +02:00
unknown
2af74b7ed8 Renamed bugs.test to default.test
Moved enabling of warnings to ensure that no warnings are generated
when this test case is executed on a clone where InnoDB is not
activated. This would fail the test case in those clones otherwise.


mysql-test/r/default.result:
  Rename: mysql-test/r/bugs.result -> mysql-test/r/default.result
mysql-test/t/default.test:
  Moved enabling of warnings to ensure that no warnings are generated
  when this test case is executed on a clone where InnoDB is not
  activated. This would fail the test case in those clones otherwise.
2005-06-01 17:36:21 +02:00
Renamed from mysql-test/r/bugs.result (Browse further)