diff options
author | unknown <monty@mashka.mysql.fi> | 2002-07-25 01:00:56 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-07-25 01:00:56 +0300 |
commit | 296adfbebffbae0a45783521d7db30810ca9d8b5 (patch) | |
tree | 568e82ff70f747c40f1e4c09d11d2c2355da2a20 /sql/item.h | |
parent | 05a0ec9aaecb9a96ba38387c556f46b9569a93ad (diff) | |
download | mariadb-git-296adfbebffbae0a45783521d7db30810ca9d8b5.tar.gz |
INSERT ... VALUES(DEFAULT)
BitKeeper/deleted/.del-insert_set.test~35be5a761a410ac1:
Delete: mysql-test/t/insert_set.test
BitKeeper/deleted/.del-insert_set.result~fca5025db098c892:
Delete: mysql-test/r/insert_set.result
Docs/manual.texi:
Changelog
mysql-test/r/insert.result:
Test new insert ... (DEFAULT)
mysql-test/t/insert.test:
Test new insert ... (DEFAULT)
sql/item.cc:
Indentation cleanup
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index a7ea48a45aa..70729afe28e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -31,7 +31,7 @@ public: enum Type {FIELD_ITEM,FUNC_ITEM,SUM_FUNC_ITEM,STRING_ITEM, INT_ITEM,REAL_ITEM,NULL_ITEM,VARBIN_ITEM, - COPY_STR_ITEM,FIELD_AVG_ITEM, + COPY_STR_ITEM,FIELD_AVG_ITEM, DEFAULT_ITEM, PROC_ITEM,COND_ITEM,REF_ITEM,FIELD_STD_ITEM, CONST_ITEM}; enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE }; @@ -285,6 +285,28 @@ public: unsigned int size_of() { return sizeof(*this);} }; + +/* For INSERT ... VALUES (DEFAULT) */ + +class Item_default :public Item +{ +public: + Item_default() { name= (char*) "DEFAULT"; } + enum Type type() const { return DEFAULT_ITEM; } + void make_field(Send_field *field) {} + bool save_in_field(Field *field) + { + field->set_default(); + return 0; + } + virtual double val() { return 0.0; } + virtual longlong val_int() { return 0; } + virtual String *val_str(String *str) { return 0; } + bool basic_const_item() const { return 1; } + unsigned int size_of() { return sizeof(*this);} +}; + + /* for show tables */ class Item_datetime :public Item_string |