summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/bigint.result4
-rw-r--r--mysql-test/t/bigint.test6
-rw-r--r--sql/ha_innodb.cc17
-rw-r--r--sql/sql_lex.cc2
-rw-r--r--sql/sql_load.cc8
-rw-r--r--sql/sql_show.cc3
6 files changed, 23 insertions, 17 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index e49e39bbbf6..12dc146ba2b 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -7,13 +7,13 @@ select 9223372036854775807,-009223372036854775808;
9223372036854775807 -9223372036854775808
select +9999999999999999999,-9999999999999999999;
+9999999999999999999 -9999999999999999999
-10000000000000000000 -10000000000000000000
+9999999999999999999 -10000000000000000000
select cast(9223372036854775808 as unsigned)+1;
cast(9223372036854775808 as unsigned)+1
9223372036854775809
select 9223372036854775808+1;
9223372036854775808+1
-9223372036854775808
+9223372036854775809
create table t1 (a bigint unsigned not null, primary key(a));
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
select * from t1;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index f583045cea9..060d45c29a4 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -12,12 +12,6 @@ select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
select 9223372036854775807,-009223372036854775808;
select +9999999999999999999,-9999999999999999999;
select cast(9223372036854775808 as unsigned)+1;
-
-#
-# We need to do a REPLACE here as the atof() function returns different
-# values on True64 and HPUX11
-#
---replace_result 9223372036854775800 9223372036854775808
select 9223372036854775808+1;
#
# In 3.23 we have to disable the test of column to bigint as
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 86c56a81b4d..31f9ba483a3 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -1282,7 +1282,13 @@ ha_innobase::open(
The column is the row id in the automatical generation case,
and it will never be updated anyway.
*/
- DBUG_ASSERT(key_used_on_scan == MAX_KEY);
+
+ if (key_used_on_scan != MAX_KEY) {
+ fprintf(stderr,
+"InnoDB: Warning: table %s key_used_on_scan is %lu even though there is no\n"
+"InnoDB: primary key inside InnoDB.\n",
+ name, (ulint)key_used_on_scan);
+ }
}
auto_inc_counter_for_this_stat = 0;
@@ -4185,9 +4191,12 @@ static void free_share(INNOBASE_SHARE *share)
/*********************************************************************
Converts a MySQL table lock stored in the 'lock' field of the handle to
-a proper type before storing the lock. MySQL also calls this when it
-releases a lock. */
-
+a proper type before storing pointer to the lock into an array of pointers.
+MySQL also calls this if it wants to reset some table locks to a not-locked
+state during the processing of an SQL query. An example is that during a
+SELECT the read lock is released early on the 'const' tables where we only
+fetch one row. MySQL does not call this when it releases all locks at the
+end of an SQL statement. */
THR_LOCK_DATA**
ha_innobase::store_lock(
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index e370ce569b5..9181b41be67 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -451,7 +451,7 @@ inline static uint int_token(const char *str,uint length)
{
cmp=longlong_str;
smaller=LONG_NUM;
- bigger=REAL_NUM;
+ bigger= ULONGLONG_NUM;
}
}
while (*cmp && *cmp++ == *str++) ;
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 9415618c561..d387ebe27ae 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -91,7 +91,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
*enclosed=ex->enclosed;
bool is_fifo=0;
LOAD_FILE_INFO lf_info;
- char * db = table_list->db ? table_list->db : thd->db;
+ char *db = table_list->db; // This is never null
+ /* If no current database, use database where table is located */
+ char *tdb= thd->db ? thd->db : db;
bool transactional_table, log_delayed;
DBUG_ENTER("mysql_load");
@@ -173,10 +175,10 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
ex->file_name+=dirname_length(ex->file_name);
#endif
if (!dirname_length(ex->file_name) &&
- strlen(ex->file_name)+strlen(mysql_data_home)+strlen(thd->db)+3 <
+ strlen(ex->file_name)+strlen(mysql_data_home)+strlen(tdb)+3 <
FN_REFLEN)
{
- (void) sprintf(name,"%s/%s/%s",mysql_data_home,thd->db,ex->file_name);
+ (void) sprintf(name,"%s/%s/%s",mysql_data_home,tdb,ex->file_name);
unpack_filename(name,name); /* Convert to system format */
}
else
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 18a11cb2c4b..e6e88b66ee7 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -512,6 +512,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
field_list.push_back(item=new Item_empty_string("Create_options",255));
item->maybe_null=1;
field_list.push_back(item=new Item_empty_string("Comment",80));
+ item->maybe_null=1;
if (protocol->send_fields(&field_list,1))
DBUG_RETURN(1);
@@ -530,7 +531,7 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
my_casedn_str(files_charset_info, file_name);
if (!(table = open_ltable(thd, &table_list, TL_READ)))
{
- for (uint i=1 ; i < field_list.elements-1 ; i++)
+ for (uint i=2 ; i < field_list.elements ; i++)
protocol->store_null();
// Send error to Comment field
protocol->store(thd->net.last_error);