diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-05-17 12:59:07 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-05-17 12:59:07 +0400 |
commit | 896c2c73a02c7e82299b00e66ee3ff5f85aa3adc (patch) | |
tree | b51a6b87f0d2488845144be585275c8cac19a1ed /sql/sql_lex.cc | |
parent | 6378c95ee07cccc2f2187b2caddc4496e14827d9 (diff) | |
parent | fba7fbbc5c7bb1d05488108a29b854ee8ef0066a (diff) | |
download | mariadb-git-10.3-MDEV-10953.tar.gz |
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.310.3-MDEV-10953
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 44a82838d8e..4c763f50eaf 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -5407,13 +5407,8 @@ sp_variable *LEX::sp_add_for_loop_variable(THD *thd, const LEX_CSTRING *name, spcont->declare_var_boundary(1); spvar->field_def.field_name= spvar->name; spvar->field_def.set_handler(&type_handler_longlong); - /* - The below is a simplified version of what - Column_definition::prepare_create_field() does for a LONGLONG field. - */ - spvar->field_def.pack_flag= (FIELDFLAG_NUMBER | - f_settype((uint) MYSQL_TYPE_LONGLONG)); - + type_handler_longlong.Column_definition_prepare_stage2(&spvar->field_def, + NULL, HA_CAN_GEOMETRY); if (!value && !(value= new (thd->mem_root) Item_null(thd))) return NULL; @@ -6404,7 +6399,6 @@ Item *LEX::create_item_func_nextval(THD *thd, Table_ident *table_ident) MDL_SHARED_WRITE))) return NULL; return new (thd->mem_root) Item_func_nextval(thd, table); - } @@ -6442,6 +6436,21 @@ Item *LEX::create_item_func_lastval(THD *thd, } +Item *LEX::create_item_func_setval(THD *thd, Table_ident *table_ident, + longlong nextval, ulonglong round, + bool is_used) +{ + TABLE_LIST *table; + if (!(table= current_select->add_table_to_list(thd, table_ident, 0, + TL_OPTION_SEQUENCE, + TL_WRITE_ALLOW_WRITE, + MDL_SHARED_WRITE))) + return NULL; + return new (thd->mem_root) Item_func_setval(thd, table, nextval, round, + is_used); +} + + Item *LEX::create_item_ident(THD *thd, const LEX_CSTRING *a, const LEX_CSTRING *b, |