summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_innobase.cc4
-rw-r--r--sql/handler.cc11
-rw-r--r--sql/sql_lex.cc16
3 files changed, 24 insertions, 7 deletions
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index 2eed5ada680..104aaf8886c 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -21,7 +21,7 @@ InnoDB */
- Ask Monty if strings of different languages can exist in the same
database. Answer: in near future yes, but not yet.
*/
-
+
#ifdef __GNUC__
#pragma implementation // gcc: Class implementation
#endif
@@ -2844,7 +2844,7 @@ ha_innobase::info(
if (records == 0) {
mean_rec_length = 0;
} else {
- mean_rec_length = (ulong) data_file_length / records;
+ mean_rec_length = (ulong) (data_file_length / records);
}
}
diff --git a/sql/handler.cc b/sql/handler.cc
index 2f6e3b11bdf..1c50634de1f 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -837,8 +837,15 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
}
error=table.file->create(name,&table,create_info);
VOID(closefrm(&table));
- if (error)
- my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
+ if (error) {
+ if (table.db_type == DB_TYPE_INNOBASE) {
+ /* Creation of InnoDB table cannot fail because of an OS error:
+ put error as the number */
+ my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
+ } else {
+ my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
+ }
+ }
DBUG_RETURN(error != 0);
}
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 20bda932f2f..e0044a0710f 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -793,9 +793,19 @@ int yylex(void *arg)
}
break;
case STATE_USER_END: // end '@' of user@hostname
- if (state_map[yyPeek()] != STATE_STRING &&
- state_map[yyPeek()] != STATE_USER_VARIABLE_DELIMITER)
- lex->next_state=STATE_HOSTNAME; // Mark for next loop
+ switch (state_map[yyPeek()])
+ {
+ case STATE_STRING:
+ case STATE_USER_VARIABLE_DELIMITER:
+ break;
+ case STATE_USER_END:
+ lex->next_state=STATE_USER_END;
+ yySkip();
+ break;
+ default:
+ lex->next_state=STATE_HOSTNAME;
+ break;
+ }
yylval->lex_str.str=(char*) lex->ptr;
yylval->lex_str.length=1;
return((int) '@');