summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-08-15 13:16:00 +0400
committerAlexander Barkov <bar@mariadb.com>2019-08-15 21:53:24 +0400
commit6073049a3675363f7d7efe26f47525b528be9e2f (patch)
treed7151b02c0f1a291e1bad7b994b2dc3982eb783c /sql/sql_lex.cc
parentae4b9b7689c49b8b8bf61d1762f452e0f14cad22 (diff)
downloadmariadb-git-6073049a3675363f7d7efe26f47525b528be9e2f.tar.gz
MDEV-20353 Add separate type handlers for unsigned integer data types
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 15d83b15ac9..8f6e86fdb48 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -5979,9 +5979,9 @@ sp_variable *LEX::sp_add_for_loop_variable(THD *thd, const LEX_CSTRING *name,
sp_variable *spvar= spcont->add_variable(thd, name);
spcont->declare_var_boundary(1);
spvar->field_def.field_name= spvar->name;
- spvar->field_def.set_handler(&type_handler_longlong);
- type_handler_longlong.Column_definition_prepare_stage2(&spvar->field_def,
- NULL, HA_CAN_GEOMETRY);
+ spvar->field_def.set_handler(&type_handler_slonglong);
+ type_handler_slonglong.Column_definition_prepare_stage2(&spvar->field_def,
+ NULL, HA_CAN_GEOMETRY);
if (!value && unlikely(!(value= new (thd->mem_root) Item_null(thd))))
return NULL;
@@ -10496,3 +10496,14 @@ Lex_cast_type_st::create_typecast_item_or_error(THD *thd, Item *item,
}
return tmp;
}
+
+
+void Lex_field_type_st::set_handler_length_flags(const Type_handler *handler,
+ const char *length,
+ uint32 flags)
+{
+ DBUG_ASSERT(!handler->is_unsigned());
+ if (flags & UNSIGNED_FLAG)
+ handler= handler->type_handler_unsigned();
+ set(handler, length, NULL);
+}