'Expand the mysql.proc table to include (almost) all fields' task(851)

Fix after review
parent 99121518
...@@ -254,8 +254,8 @@ then ...@@ -254,8 +254,8 @@ then
c_p="$c_p type enum('function','procedure') NOT NULL," c_p="$c_p type enum('function','procedure') NOT NULL,"
c_p="$c_p body blob DEFAULT '' NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL,"
c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL,"
c_p="$c_p created timestamp,"
c_p="$c_p modified timestamp," c_p="$c_p modified timestamp,"
c_p="$c_p created timestamp,"
c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL,"
c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL,"
c_p="$c_p PRIMARY KEY (name,type)" c_p="$c_p PRIMARY KEY (name,type)"
......
...@@ -362,8 +362,8 @@ then ...@@ -362,8 +362,8 @@ then
c_p="$c_p type enum('function','procedure') NOT NULL," c_p="$c_p type enum('function','procedure') NOT NULL,"
c_p="$c_p body blob DEFAULT '' NOT NULL," c_p="$c_p body blob DEFAULT '' NOT NULL,"
c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL," c_p="$c_p creator char(77) binary DEFAULT '' NOT NULL,"
c_p="$c_p created timestamp,"
c_p="$c_p modified timestamp," c_p="$c_p modified timestamp,"
c_p="$c_p created timestamp,"
c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL," c_p="$c_p suid enum ('N', 'Y') DEFAULT 'Y' NOT NULL,"
c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL," c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL,"
c_p="$c_p PRIMARY KEY (name,type)" c_p="$c_p PRIMARY KEY (name,type)"
......
...@@ -118,8 +118,8 @@ db_find_routine(THD *thd, int type, char *name, uint namelen, sp_head **sphp) ...@@ -118,8 +118,8 @@ db_find_routine(THD *thd, int type, char *name, uint namelen, sp_head **sphp)
goto done; goto done;
} }
created= table->field[4]->val_int(); modified= table->field[4]->val_int();
modified= table->field[5]->val_int(); created= table->field[5]->val_int();
if ((ptr= get_field(&thd->mem_root, table->field[6])) == NULL) if ((ptr= get_field(&thd->mem_root, table->field[6])) == NULL)
{ {
...@@ -130,14 +130,9 @@ db_find_routine(THD *thd, int type, char *name, uint namelen, sp_head **sphp) ...@@ -130,14 +130,9 @@ db_find_routine(THD *thd, int type, char *name, uint namelen, sp_head **sphp)
suid= 0; suid= 0;
table->field[7]->val_str(&str,&str); table->field[7]->val_str(&str,&str);
length=str.length();
ptr= 0; ptr= 0;
if (length) if ((length= str.length()))
{ ptr= strmake_root(&thd->mem_root, str.ptr(),length);
ptr= (char*) alloc_root(&thd->mem_root,length+1);
memcpy(ptr,str.ptr(),(uint) length);
ptr[length]=0;
}
if (opened) if (opened)
{ {
...@@ -203,6 +198,7 @@ db_create_routine(THD *thd, int type, ...@@ -203,6 +198,7 @@ db_create_routine(THD *thd, int type,
table->field[1]->store((longlong)type); table->field[1]->store((longlong)type);
table->field[2]->store(def, deflen, system_charset_info); table->field[2]->store(def, deflen, system_charset_info);
table->field[3]->store(creator, (uint) strlen(creator), system_charset_info); table->field[3]->store(creator, (uint) strlen(creator), system_charset_info);
((Field_timestamp*) table->field[5])->set_time();
if (suid) if (suid)
table->field[6]->store((longlong) suid); table->field[6]->store((longlong) suid);
if (comment) if (comment)
......
...@@ -101,7 +101,7 @@ sp_head::sp_head(LEX_STRING *name, LEX *lex, LEX_STRING *comment, char suid) ...@@ -101,7 +101,7 @@ sp_head::sp_head(LEX_STRING *name, LEX *lex, LEX_STRING *comment, char suid)
m_name.length= name->length; m_name.length= name->length;
m_name.str= name->str; m_name.str= name->str;
m_defstr.length= lex->end_of_query - lex->buf; m_defstr.length= lex->end_of_query - lex->buf;
m_defstr.str= sql_strmake(dstr, m_defstr.length); m_defstr.str= lex->thd->strmake(dstr, m_defstr.length);
m_comment.length= 0; m_comment.length= 0;
m_comment.str= 0; m_comment.str= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment