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

After merge fixes

This commit is contained in:
monty@mysql.com
2005-06-07 05:43:59 +03:00
parent 775f17667b
commit 068bd3eb97
7 changed files with 51 additions and 56 deletions

View File

@ -1450,16 +1450,22 @@ test.t3 NULL
test.t4 NULL test.t4 NULL
Warnings: Warnings:
Error 1146 Table 'test.t4' doesn't exist Error 1146 Table 'test.t4' doesn't exist
checksum table t1, t2, t3; checksum table t1, t2, t3, t4;
Table Checksum Table Checksum
test.t1 2948697075 test.t1 2948697075
test.t2 1157260244 test.t2 1157260244
test.t3 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 Table Checksum
test.t1 3092701434 test.t1 3092701434
test.t2 1157260244 test.t2 1157260244
test.t3 1157260244 test.t3 1157260244
test.t4 NULL
Warnings:
Error 1146 Table 'test.t4' doesn't exist
drop table t1,t2,t3; drop table t1,t2,t3;
create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; 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'); 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; drop table t2, t1;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 154 Binlog_cache_use 153
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 0 Binlog_cache_disk_use 0
create table t1 (a int) engine=innodb; create table t1 (a int) engine=innodb;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 155 Binlog_cache_use 154
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
@ -1648,7 +1654,7 @@ delete from t1;
commit; commit;
show status like "binlog_cache_use"; show status like "binlog_cache_use";
Variable_name Value Variable_name Value
Binlog_cache_use 156 Binlog_cache_use 155
show status like "binlog_cache_disk_use"; show status like "binlog_cache_disk_use";
Variable_name Value Variable_name Value
Binlog_cache_disk_use 1 Binlog_cache_disk_use 1
@ -1738,7 +1744,7 @@ Variable_name Value
Innodb_rows_deleted 2070 Innodb_rows_deleted 2070
show status like "Innodb_rows_inserted"; show status like "Innodb_rows_inserted";
Variable_name Value Variable_name Value
Innodb_rows_inserted 31709 Innodb_rows_inserted 31718
show status like "Innodb_rows_updated"; show status like "Innodb_rows_updated";
Variable_name Value Variable_name Value
Innodb_rows_updated 29530 Innodb_rows_updated 29530

View File

@ -185,44 +185,44 @@ create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10); insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc'; update t1 set a='abc';
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 1 Warning 1264 Out of range value adjusted for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3 Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4 Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5 Warning 1264 Out of range value adjusted for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6 Warning 1264 Out of range value adjusted for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7 Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8 Warning 1264 Out of range value adjusted for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9 Warning 1264 Out of range value adjusted 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 10
show warnings limit 2, 1; show warnings limit 2, 1;
Level Code Message 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; show warnings limit 0, 10;
Level Code Message 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
Warning 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 2
Warning 1265 Data truncated for column 'a' at row 3 Warning 1264 Out of range value adjusted for column 'a' at row 3
Warning 1265 Data truncated for column 'a' at row 4 Warning 1264 Out of range value adjusted for column 'a' at row 4
Warning 1265 Data truncated for column 'a' at row 5 Warning 1264 Out of range value adjusted for column 'a' at row 5
Warning 1265 Data truncated for column 'a' at row 6 Warning 1264 Out of range value adjusted for column 'a' at row 6
Warning 1265 Data truncated for column 'a' at row 7 Warning 1264 Out of range value adjusted for column 'a' at row 7
Warning 1265 Data truncated for column 'a' at row 8 Warning 1264 Out of range value adjusted for column 'a' at row 8
Warning 1265 Data truncated for column 'a' at row 9 Warning 1264 Out of range value adjusted 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 10
show warnings limit 9, 1; show warnings limit 9, 1;
Level Code Message 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; show warnings limit 10, 1;
Level Code Message Level Code Message
show warnings limit 9, 2; show warnings limit 9, 2;
Level Code Message 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; show warnings limit 0, 0;
Level Code Message Level Code Message
show warnings limit 1; show warnings limit 1;
Level Code Message 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; show warnings limit 0;
Level Code Message Level Code Message
show warnings limit 1, 0; show warnings limit 1, 0;

View File

@ -4414,8 +4414,7 @@ bool Item_direct_ref::val_bool()
bool Item_direct_ref::is_null() bool Item_direct_ref::is_null()
{ {
(void) (*ref)->val_int(); return (*ref)->is_null();
return (*ref)->null_value;
} }

View File

@ -2395,7 +2395,7 @@ longlong Item_func_field::val_int()
return 0; return 0;
for (uint i=1; i < arg_count ; i++) 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); return (longlong) (i);
} }
} }

View File

@ -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; Item_func_group_concat* grp_item= (Item_func_group_concat*)arg;
TABLE *table= grp_item->table; TABLE *table= grp_item->table;
Item **field_item, **end; 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; for (field_item= grp_item->args, end= field_item + grp_item->arg_count_field;
field_item < end; field_item < end;
@ -2630,7 +2629,7 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
if (field) if (field)
{ {
int res; 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))) if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return res; 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; Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
ORDER **order_item, **end; ORDER **order_item, **end;
TABLE *table= grp_item->table; 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; for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order;
order_item < end; order_item < end;
@ -2666,7 +2664,7 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
if (field) if (field)
{ {
int res; 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))) if ((res= field->cmp((char *) key1 + offset, (char *) key2 + offset)))
return (*order_item)->asc ? res : -res; 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) Item_func_group_concat *item)
{ {
TABLE *table= item->table; TABLE *table= item->table;
char *record= (char*) table->record[0] + table->s->null_bytes; String tmp((char *)table->record[1], table->s->reclength,
String tmp((char *)table->record[1], table->s->reclength, default_charset_info), tmp2; default_charset_info);
String tmp2;
String *result= &item->result; String *result= &item->result;
Item **arg= item->args, **arg_end= item->args + item->arg_count_field; 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. because it contains both order and arg list fields.
*/ */
Field *field= (*arg)->get_tmp_table_field(); Field *field= (*arg)->get_tmp_table_field();
char *save_ptr= field->ptr; uint offset= field->offset() - table->s->null_bytes;
uint offset= (uint) (save_ptr - record);
DBUG_ASSERT(offset < table->s->reclength); DBUG_ASSERT(offset < table->s->reclength);
field->ptr= (char *) key + offset; res= field->val_str(&tmp, (char *) key + offset);
res= field->val_str(&tmp,&tmp2);
field->ptr= save_ptr;
} }
else else
res= (*arg)->val_str(&tmp); res= (*arg)->val_str(&tmp);
@ -2917,12 +2913,8 @@ bool Item_func_group_concat::add()
Item *show_item= args[i]; Item *show_item= args[i];
if (!show_item->const_item()) if (!show_item->const_item())
{ {
/* Field *f= show_item->get_tmp_table_field();
Here we use real_item as we want the original field data that should if (f->is_null_in_record((const uchar*) table->record[0]))
be written to table->record[0]
*/
Field *f= show_item->real_item()->get_tmp_table_field();
if (f->is_null())
return 0; // Skip row if it contains null return 0; // Skip row if it contains null
} }
} }

View File

@ -5028,7 +5028,7 @@ bool check_stack_overrun(THD *thd, long margin,
{ {
long stack_used; long stack_used;
if ((stack_used=used_stack(thd->thread_stack,(char*) &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); sprintf(errbuff[0],ER(ER_STACK_OVERRUN),stack_used,thread_stack);
my_message(ER_STACK_OVERRUN,errbuff[0],MYF(0)); my_message(ER_STACK_OVERRUN,errbuff[0],MYF(0));

View File

@ -13089,16 +13089,14 @@ bool JOIN::rollup_make_fields(List<Item> &fields_arg, List<Item> &sel_fields,
{ {
if (item->eq(*group_tmp->item,0)) 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 This is an element that is used by the GROUP BY and should be
set to NULL in this level 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 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(); null_item->result_field= item->get_tmp_table_field();
item= null_item; item= null_item;
break; break;