diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 033409f3d77..1c91c964cb9 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5899,16 +5899,16 @@ insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, show create table examplebug20777; Table Create Table examplebug20777 CREATE TABLE `examplebug20777` ( - `i` int(1) NOT NULL default '0', - `2**63-2` bigint(20) unsigned default NULL, - `2**63-1` bigint(20) unsigned default NULL, - `2**63` bigint(20) unsigned default NULL, - `2**63+1` bigint(20) unsigned default NULL, - `2**64-2` bigint(20) unsigned default NULL, - `2**64-1` bigint(20) unsigned default NULL, - `2**64` bigint(20) unsigned default NULL, - `0` bigint(20) unsigned default NULL, - `-1` bigint(20) unsigned default NULL + `i` int(1) NOT NULL DEFAULT '0', + `2**63-2` bigint(20) unsigned DEFAULT NULL, + `2**63-1` bigint(20) unsigned DEFAULT NULL, + `2**63` bigint(20) unsigned DEFAULT NULL, + `2**63+1` bigint(20) unsigned DEFAULT NULL, + `2**64-2` bigint(20) unsigned DEFAULT NULL, + `2**64-1` bigint(20) unsigned DEFAULT NULL, + `2**64` bigint(20) unsigned DEFAULT NULL, + `0` bigint(20) unsigned DEFAULT NULL, + `-1` bigint(20) unsigned DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from examplebug20777 order by i; i 2**63-2 2**63-1 2**63 2**63+1 2**64-2 2**64-1 2**64 0 -1 diff --git a/sql/item_func.cc b/sql/item_func.cc index 2cb67cb28a4..601682e0313 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5009,7 +5009,7 @@ Item_func_sp::cleanup() sp_result_field= NULL; } m_sp= NULL; - dummy_table->s= NULL; + dummy_table->alias= NULL; Item_func::cleanup(); } @@ -5057,13 +5057,13 @@ bool Item_func_sp::init_result_field(THD *thd) { DBUG_ENTER("Item_func_sp::init_result_field"); + + LEX_STRING empty_name= { STRING_WITH_LEN("") }; - char *empty_name= (char *) ""; TABLE_SHARE *share; DBUG_ASSERT(m_sp == NULL); DBUG_ASSERT(sp_result_field == NULL); - DBUG_ASSERT(dummy_table->s == NULL); if (!(m_sp= sp_find_routine(thd, TYPE_ENUM_FUNCTION, m_name, &thd->sp_func_cache, TRUE))) @@ -5078,8 +5078,9 @@ Item_func_sp::init_result_field(THD *thd) Below we "create" a dummy table by initializing the needed pointers. */ - dummy_table->s= share= &dummy_table->share_not_to_be_used; - dummy_table->alias = empty_name; + + share= dummy_table->s; + dummy_table->alias = ""; dummy_table->maybe_null = maybe_null; dummy_table->in_use= thd; dummy_table->copy_blobs= TRUE;