Commit 068bd3eb authored by monty@mysql.com's avatar monty@mysql.com

After merge fixes

parent 775f1766
......@@ -1450,16 +1450,22 @@ test.t3 NULL
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3;
checksum table t1, t2, t3, t4;
Table Checksum
test.t1 2948697075
test.t2 1157260244
test.t3 1157260244
checksum table t1, t2, t3 extended;
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3, t4 extended;
Table Checksum
test.t1 3092701434
test.t2 1157260244
test.t3 1157260244
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
drop table t1,t2,t3;
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
......@@ -1632,14 +1638,14 @@ t2 CREATE TABLE `t2` (
drop table t2, t1;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 154
Binlog_cache_use 153
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 155
Binlog_cache_use 154
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
......@@ -1648,7 +1654,7 @@ delete from t1;
commit;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 156
Binlog_cache_use 155
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
......@@ -1738,7 +1744,7 @@ Variable_name Value
Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted";
Variable_name Value
Innodb_rows_inserted 31709
Innodb_rows_inserted 31718
show status like "Innodb_rows_updated";
Variable_name Value
Innodb_rows_updated 29530
......
......@@ -185,44 +185,44 @@ create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9
Warning 1265 Data truncated for column 'a' at row 10
Warning 1264 Out of range value adjusted for column 'a' at row 1
Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1264 Out of range value adjusted for column 'a' at row 5
Warning 1264 Out of range value adjusted for column 'a' at row 6
Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1264 Out of range value adjusted for column 'a' at row 8
Warning 1264 Out of range value adjusted for column 'a' at row 9
Warning 1264 Out of range value adjusted for column 'a' at row 10
show warnings limit 2, 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 3
Warning 1264 Out of range value adjusted for column 'a' at row 3
show warnings limit 0, 10;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9
Warning 1265 Data truncated for column 'a' at row 10
Warning 1264 Out of range value adjusted for column 'a' at row 1
Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1264 Out of range value adjusted for column 'a' at row 5
Warning 1264 Out of range value adjusted for column 'a' at row 6
Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1264 Out of range value adjusted for column 'a' at row 8
Warning 1264 Out of range value adjusted for column 'a' at row 9
Warning 1264 Out of range value adjusted for column 'a' at row 10
show warnings limit 9, 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 10
Warning 1264 Out of range value adjusted for column 'a' at row 10
show warnings limit 10, 1;
Level Code Message
show warnings limit 9, 2;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 10
Warning 1264 Out of range value adjusted for column 'a' at row 10
show warnings limit 0, 0;
Level Code Message
show warnings limit 1;
Level Code Message
Warning 1265 Data truncated for column 'a' at row 1
Warning 1264 Out of range value adjusted for column 'a' at row 1
show warnings limit 0;
Level Code Message
show warnings limit 1, 0;
......
......@@ -4414,8 +4414,7 @@ bool Item_direct_ref::val_bool()
bool Item_direct_ref::is_null()
{
(void) (*ref)->val_int();
return (*ref)->null_value;
return (*ref)->is_null();
}
......
......@@ -2395,7 +2395,7 @@ longlong Item_func_field::val_int()
return 0;
for (uint i=1; i < arg_count ; i++)
{
if (val == args[i]->val() && !args[i]->null_value)
if (val == args[i]->val_real() && !args[i]->null_value)
return (longlong) (i);
}
}
......
......@@ -2615,7 +2615,6 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
Item_func_group_concat* grp_item= (Item_func_group_concat*)arg;
TABLE *table= grp_item->table;
Item **field_item, **end;
char *record= (char*) table->record[0] + table->s->null_bytes;
for (field_item= grp_item->args, end= field_item + grp_item->arg_count_field;
field_item < end;
......@@ -2630,7 +2629,7 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
if (field)
{
int res;
uint offset= (uint) (field->ptr - record);
uint offset= field->offset() - table->s->null_bytes;
if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return res;
}
......@@ -2649,7 +2648,6 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
ORDER **order_item, **end;
TABLE *table= grp_item->table;
char *record= (char*) table->record[0] + table->s->null_bytes;
for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order;
order_item < end;
......@@ -2666,7 +2664,7 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
if (field)
{
int res;
uint offset= (uint) (field->ptr - record);
uint offset= field->offset() - table->s->null_bytes;
if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return (*order_item)->asc ? res : -res;
}
......@@ -2707,8 +2705,9 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
Item_func_group_concat *item)
{
TABLE *table= item->table;
char *record= (char*) table->record[0] + table->s->null_bytes;
String tmp((char *)table->record[1], table->s->reclength, default_charset_info), tmp2;
String tmp((char *)table->record[1], table->s->reclength,
default_charset_info);
String tmp2;
String *result= &item->result;
Item **arg= item->args, **arg_end= item->args + item->arg_count_field;
......@@ -2730,12 +2729,9 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
because it contains both order and arg list fields.
*/
Field *field= (*arg)->get_tmp_table_field();
char *save_ptr= field->ptr;
uint offset= (uint) (save_ptr - record);
uint offset= field->offset() - table->s->null_bytes;
DBUG_ASSERT(offset < table->s->reclength);
field->ptr= (char *) key + offset;
res= field->val_str(&tmp,&tmp2);
field->ptr= save_ptr;
res= field->val_str(&tmp, (char *) key + offset);
}
else
res= (*arg)->val_str(&tmp);
......@@ -2917,12 +2913,8 @@ bool Item_func_group_concat::add()
Item *show_item= args[i];
if (!show_item->const_item())
{
/*
Here we use real_item as we want the original field data that should
be written to table->record[0]
*/
Field *f= show_item->real_item()->get_tmp_table_field();
if (f->is_null())
Field *f= show_item->get_tmp_table_field();
if (f->is_null_in_record((const uchar*) table->record[0]))
return 0; // Skip row if it contains null
}
}
......
......@@ -5028,7 +5028,7 @@ bool check_stack_overrun(THD *thd, long margin,
{
long stack_used;
if ((stack_used=used_stack(thd->thread_stack,(char*) &stack_used)) >=
thread_stack - margin)
(long) (thread_stack - margin))
{
sprintf(errbuff[0],ER(ER_STACK_OVERRUN),stack_used,thread_stack);
my_message(ER_STACK_OVERRUN,errbuff[0],MYF(0));
......
......@@ -13089,16 +13089,14 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
{
if (item->eq(*group_tmp->item,0))
{
Item_null_result *null_item;
/*
This is an element that is used by the GROUP BY and should be
set to NULL in this level
*/
Item_null_result *null_item;
Item_null_result *null_item= new (thd->mem_root) Item_null_result();
if (!null_item)
return 1;
item->maybe_null= 1; // Value will be null sometimes
null_item= rollup.null_items[i];
DBUG_ASSERT(null_item->result_field == 0 ||
null_item->result_field == item->get_tmp_table_field());
null_item->result_field= item->get_tmp_table_field();
item= null_item;
break;
......
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