1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge mysql.com:/nfsdisk1/lars/bk/mysql-5.1

into  mysql.com:/nfsdisk1/lars/bk/mysql-5.1-new-rpl
This commit is contained in:
lars/lthalmann@dl145k.mysql.com
2007-06-21 17:13:02 +02:00
55 changed files with 2180 additions and 955 deletions

View File

@ -5354,12 +5354,11 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
sp_cache_flush_obsolete(&thd->sp_func_cache);
Lex_input_stream lip(thd, inBuf, length);
thd->m_lip= &lip;
int err= MYSQLparse(thd);
bool err= parse_sql(thd, &lip);
*found_semicolon= lip.found_semicolon;
if (!err && ! thd->is_fatal_error)
if (!err)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
if (mqh_used && thd->user_connect &&
@ -5382,8 +5381,8 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
PROCESSLIST.
Note that we don't need LOCK_thread_count to modify query_length.
*/
if (lip.found_semicolon &&
(thd->query_length= (ulong)(lip.found_semicolon - thd->query)))
if (*found_semicolon &&
(thd->query_length= (ulong)(*found_semicolon - thd->query)))
thd->query_length--;
/* Actually execute the query */
mysql_execute_command(thd);
@ -5437,12 +5436,10 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
DBUG_ENTER("mysql_test_parse_for_slave");
Lex_input_stream lip(thd, inBuf, length);
thd->m_lip= &lip;
lex_start(thd);
mysql_reset_thd_for_next_command(thd);
int err= MYSQLparse((void*) thd);
if (!err && ! thd->is_fatal_error &&
if (!parse_sql(thd, &lip) &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */
thd->end_statement();
@ -5467,7 +5464,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
List<String> *interval_list, CHARSET_INFO *cs,
uint uint_geom_type)
{
register create_field *new_field;
register Create_field *new_field;
LEX *lex= thd->lex;
DBUG_ENTER("add_field_to_list");
@ -5480,7 +5477,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & PRI_KEY_FLAG)
{
Key *key;
lex->col_list.push_back(new key_part_spec(field_name->str, 0));
lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
key= new Key(Key::PRIMARY, NullS,
&default_key_create_info,
0, lex->col_list);
@ -5490,7 +5487,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
{
Key *key;
lex->col_list.push_back(new key_part_spec(field_name->str, 0));
lex->col_list.push_back(new Key_part_spec(field_name->str, 0));
key= new Key(Key::UNIQUE, NullS,
&default_key_create_info, 0,
lex->col_list);
@ -5548,7 +5545,7 @@ bool add_field_to_list(THD *thd, LEX_STRING *field_name, enum_field_types type,
WARN_DEPRECATED(thd, "5.2", buf, "'TIMESTAMP'");
}
if (!(new_field= new create_field()) ||
if (!(new_field= new Create_field()) ||
new_field->init(thd, field_name->str, type, length, decimals, type_modifier,
default_value, on_update_value, comment, change,
interval_list, cs, uint_geom_type))
@ -7134,3 +7131,34 @@ bool check_string_char_length(LEX_STRING *str, const char *err_msg,
my_error(ER_WRONG_STRING_LENGTH, MYF(0), str->str, err_msg, max_char_length);
return TRUE;
}
extern int MYSQLparse(void *thd); // from sql_yacc.cc
/**
This is a wrapper of MYSQLparse(). All the code should call parse_sql()
instead of MYSQLparse().
@param thd Thread context.
@param lip Lexer context.
@return Error status.
@retval FALSE on success.
@retval TRUE on parsing error.
*/
bool parse_sql(THD *thd, Lex_input_stream *lip)
{
bool err_status;
DBUG_ASSERT(thd->m_lip == NULL);
thd->m_lip= lip;
err_status= MYSQLparse(thd) != 0 || thd->is_fatal_error;
thd->m_lip= NULL;
return err_status;
}