mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Renamed stripp_sp -> strip_sp
Remove end space from ENUM and SET strings mysql-test/t/type_enum.test: Test of end space in enum's Docs/manual.texi: Changelog include/my_sys.h: Renamed stripp_sp -> strip_sp mysql-test/r/type_enum.result: Test of end space in enums mysys/Makefile.am: change stripp_sp -> strip_sp mysys/mf_strip.c: change stripp_sp -> strip_sp sql/sql_db.cc: change stripp_sp -> strip_sp sql/sql_parse.cc: change stripp_sp -> strip_sp Remove end space from ENUM and SET strings
This commit is contained in:
@ -880,7 +880,7 @@ bool do_command(THD *thd)
|
||||
char *db=thd->strdup(packet+1);
|
||||
thread_safe_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_thread_count);
|
||||
// null test to handle EOM
|
||||
if (!db || !stripp_sp(db) || check_db_name(db))
|
||||
if (!db || !strip_sp(db) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -896,7 +896,7 @@ bool do_command(THD *thd)
|
||||
char *db=thd->strdup(packet+1);
|
||||
thread_safe_increment(com_stat[SQLCOM_DROP_DB],&LOCK_thread_count);
|
||||
// null test to handle EOM
|
||||
if (!db || !stripp_sp(db) || check_db_name(db))
|
||||
if (!db || !strip_sp(db) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -1905,7 +1905,7 @@ mysql_execute_command(void)
|
||||
break;
|
||||
case SQLCOM_CREATE_DB:
|
||||
{
|
||||
if (!stripp_sp(lex->name) || check_db_name(lex->name))
|
||||
if (!strip_sp(lex->name) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
@ -1917,7 +1917,7 @@ mysql_execute_command(void)
|
||||
}
|
||||
case SQLCOM_DROP_DB:
|
||||
{
|
||||
if (!stripp_sp(lex->name) || check_db_name(lex->name))
|
||||
if (!strip_sp(lex->name) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
@ -2561,7 +2561,9 @@ bool add_field_to_list(char *field_name, enum_field_types type,
|
||||
new_field->interval=interval;
|
||||
new_field->length=0;
|
||||
for (const char **pos=interval->type_names; *pos ; pos++)
|
||||
new_field->length+=(uint) strlen(*pos)+1;
|
||||
{
|
||||
new_field->length+=(uint) strip_sp((char*) *pos)+1;
|
||||
}
|
||||
new_field->length--;
|
||||
set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1);
|
||||
if (default_value)
|
||||
@ -2582,10 +2584,10 @@ bool add_field_to_list(char *field_name, enum_field_types type,
|
||||
{
|
||||
new_field->interval=interval;
|
||||
new_field->pack_length=interval->count < 256 ? 1 : 2; // Should be safe
|
||||
new_field->length=(uint) strlen(interval->type_names[0]);
|
||||
new_field->length=(uint) strip_sp((char*) interval->type_names[0]);
|
||||
for (const char **pos=interval->type_names+1; *pos ; pos++)
|
||||
{
|
||||
uint length=(uint) strlen(*pos);
|
||||
uint length=(uint) strip_sp((char*) *pos);
|
||||
set_if_bigger(new_field->length,length);
|
||||
}
|
||||
set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1);
|
||||
|
Reference in New Issue
Block a user