Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-03 09:32:58+02:00, msvensson@neptunus.(none) +17 -0
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
MERGE: 1.2226.1.8
client/mysql.cc@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.209.2.2
client/mysqltest.c@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.237.2.1
mysql-test/mysql-test-run.pl@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.104.1.2
mysql-test/r/date_formats.result@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.25.1.1
mysql-test/r/func_group.result@stripped, 2006-08-03 09:32:55+02:00, msvensson@neptunus.(none) +0 -0
Merge manually
MERGE: 1.46.1.8
mysql-test/r/union.result@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.82.1.1
mysql-test/t/func_group.test@stripped, 2006-08-03 09:32:55+02:00, msvensson@neptunus.(none) +2 -1
Merge manually
MERGE: 1.45.1.4
mysql-test/t/union.test@stripped, 2006-08-03 09:30:57+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.95.1.1
sql/field.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.318.1.1
sql/item.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.228.1.2
sql/item_func.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.293.1.1
sql/item_func.h@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.141.1.2
sql/item_strfunc.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.275.1.4
sql/item_strfunc.h@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.110.1.2
sql/item_subselect.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.127.1.2
sql/item_sum.cc@stripped, 2006-08-03 09:30:58+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.177.1.1
sql/sql_yacc.yy@stripped, 2006-08-03 09:30:59+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.474.1.3
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0-maint/RESYNC
--- 1.211/client/mysql.cc 2006-08-03 09:33:03 +02:00
+++ 1.212/client/mysql.cc 2006-08-03 09:33:03 +02:00
@@ -1221,7 +1221,8 @@ static bool add_line(String &buffer,char
continue;
}
#endif
- if (!*ml_comment && inchar == '\\')
+ if (!*ml_comment && inchar == '\\' &&
+ !(mysql.server_status & SERVER_STATUS_NO_BACKSLASH_ESCAPES))
{
// Found possbile one character command like \c
--- 1.319/sql/field.cc 2006-08-03 09:33:03 +02:00
+++ 1.320/sql/field.cc 2006-08-03 09:33:03 +02:00
@@ -4387,6 +4387,24 @@ Field_timestamp::Field_timestamp(char *p
}
+Field_timestamp::Field_timestamp(bool maybe_null_arg,
+ const char *field_name_arg,
+ struct st_table *table_arg, CHARSET_INFO *cs)
+ :Field_str((char*) 0, 19, maybe_null_arg ? (uchar*) "": 0, 0,
+ NONE, field_name_arg, table_arg, cs)
+{
+ /* For 4.0 MYD and 4.0 InnoDB compatibility */
+ flags|= ZEROFILL_FLAG | UNSIGNED_FLAG;
+ if (table && !table->timestamp_field &&
+ unireg_check != NONE)
+ {
+ /* This timestamp has auto-update */
+ table->timestamp_field= this;
+ flags|=TIMESTAMP_FLAG;
+ }
+}
+
+
/*
Get auto-set type for TIMESTAMP field.
--- 1.229/sql/item.cc 2006-08-03 09:33:03 +02:00
+++ 1.230/sql/item.cc 2006-08-03 09:33:03 +02:00
@@ -1424,7 +1424,8 @@ bool agg_item_charsets(DTCollation &coll
In case we're in statement prepare, create conversion item
in its memory: it will be reused on each execute.
*/
- arena= thd->activate_stmt_arena_if_needed(&backup);
+ arena= thd->is_stmt_prepare() ? thd->activate_stmt_arena_if_needed(&backup)
+ : NULL;
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
{
@@ -1459,7 +1460,7 @@ bool agg_item_charsets(DTCollation &coll
been created in prepare. In this case register the change for
rollback.
*/
- if (arena && arena->is_conventional())
+ if (arena)
*arg= conv;
else
thd->change_item_tree(arg, conv);
@@ -3903,7 +3904,9 @@ Field *Item::make_string_field(TABLE *ta
if (max_length/collation.collation->mbmaxlen > CONVERT_IF_BIGGER_TO_BLOB)
return new Field_blob(max_length, maybe_null, name, table,
collation.collation);
- if (max_length > 0)
+ /* Item_type_holder holds the exact type, do not change it */
+ if (max_length > 0 &&
+ (type() != Item::TYPE_HOLDER || field_type() != MYSQL_TYPE_STRING))
return new Field_varstring(max_length, maybe_null, name, table,
collation.collation);
return new Field_string(max_length, maybe_null, name, table,
@@ -3967,6 +3970,7 @@ Field *Item::tmp_table_field_from_field_
case MYSQL_TYPE_TIME:
return new Field_time(maybe_null, name, table, &my_charset_bin);
case MYSQL_TYPE_TIMESTAMP:
+ return new Field_timestamp(maybe_null, name, table, &my_charset_bin);
case MYSQL_TYPE_DATETIME:
return new Field_datetime(maybe_null, name, table, &my_charset_bin);
case MYSQL_TYPE_YEAR:
@@ -3990,7 +3994,11 @@ Field *Item::tmp_table_field_from_field_
case MYSQL_TYPE_LONG_BLOB:
case MYSQL_TYPE_BLOB:
case MYSQL_TYPE_GEOMETRY:
- return new Field_blob(max_length, maybe_null, name, table,
+ if (this->type() == Item::TYPE_HOLDER)
+ return new Field_blob(max_length, maybe_null, name, table,
+ collation.collation, 1);
+ else
+ return new Field_blob(max_length, maybe_null, name, table,
collation.collation);
break; // Blob handled outside of case
}
@@ -6159,7 +6167,7 @@ uint32 Item_type_holder::display_length(
case MYSQL_TYPE_DOUBLE:
return 53;
case MYSQL_TYPE_NULL:
- return 4;
+ return 0;
case MYSQL_TYPE_LONGLONG:
return 20;
case MYSQL_TYPE_INT24:
--- 1.295/sql/item_func.cc 2006-08-03 09:33:03 +02:00
+++ 1.296/sql/item_func.cc 2006-08-03 09:33:03 +02:00
@@ -3413,6 +3413,7 @@ static user_var_entry *get_variable(HASH
entry->length=0;
entry->update_query_id=0;
entry->collation.set(NULL, DERIVATION_IMPLICIT);
+ entry->unsigned_flag= 0;
/*
If we are here, we were called from a SET or a query which sets a
variable. Imagine it is this:
@@ -3499,6 +3500,7 @@ Item_func_set_user_var::fix_length_and_d
type - type of new value
cs - charset info for new value
dv - derivation for new value
+ unsigned_arg - indiates if a value of type INT_RESULT is unsigned
RETURN VALUE
False - success, True - failure
@@ -3506,7 +3508,8 @@ Item_func_set_user_var::fix_length_and_d
static bool
update_hash(user_var_entry *entry, bool set_null, void *ptr, uint length,
- Item_result type, CHARSET_INFO *cs, Derivation dv)
+ Item_result type, CHARSET_INFO *cs, Derivation dv,
+ bool unsigned_arg)
{
if (set_null)
{
@@ -3554,6 +3557,7 @@ update_hash(user_var_entry *entry, bool
((my_decimal*)entry->value)->fix_buffer_pointer();
entry->length= length;
entry->collation.set(cs, dv);
+ entry->unsigned_flag= unsigned_arg;
}
entry->type=type;
return 0;
@@ -3562,7 +3566,8 @@ update_hash(user_var_entry *entry, bool
bool
Item_func_set_user_var::update_hash(void *ptr, uint length, Item_result type,
- CHARSET_INFO *cs, Derivation dv)
+ CHARSET_INFO *cs, Derivation dv,
+ bool unsigned_arg)
{
/*
If we set a variable explicitely to NULL then keep the old
@@ -3571,7 +3576,7 @@ Item_func_set_user_var::update_hash(void
if ((null_value= args[0]->null_value) && null_item)
type= entry->type; // Don't change type of item
if (::update_hash(entry, (null_value= args[0]->null_value),
- ptr, length, type, cs, dv))
+ ptr, length, type, cs, dv, unsigned_arg))
{
current_thd->fatal_error(); // Probably end of memory
null_value= 1;
@@ -3653,7 +3658,10 @@ String *user_var_entry::val_str(my_bool
str->set(*(double*) value, decimals, &my_charset_bin);
break;
case INT_RESULT:
- str->set(*(longlong*) value, &my_charset_bin);
+ if (!unsigned_flag)
+ str->set(*(longlong*) value, &my_charset_bin);
+ else
+ str->set(*(ulonglong*) value, &my_charset_bin);
break;
case DECIMAL_RESULT:
my_decimal2string(E_DEC_FATAL_ERROR, (my_decimal *)value, 0, 0, 0, str);
@@ -3724,6 +3732,7 @@ Item_func_set_user_var::check()
case INT_RESULT:
{
save_result.vint= args[0]->val_int();
+ unsigned_flag= args[0]->unsigned_flag;
break;
}
case STRING_RESULT:
@@ -3779,7 +3788,8 @@ Item_func_set_user_var::update()
case INT_RESULT:
{
res= update_hash((void*) &save_result.vint, sizeof(save_result.vint),
- INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT);
+ INT_RESULT, &my_charset_bin, DERIVATION_IMPLICIT,
+ unsigned_flag);
break;
}
case STRING_RESULT:
@@ -4158,7 +4168,7 @@ bool Item_user_var_as_out_param::fix_fie
void Item_user_var_as_out_param::set_null_value(CHARSET_INFO* cs)
{
if (::update_hash(entry, TRUE, 0, 0, STRING_RESULT, cs,
- DERIVATION_IMPLICIT))
+ DERIVATION_IMPLICIT, 0 /* unsigned_arg */))
current_thd->fatal_error(); // Probably end of memory
}
@@ -4167,7 +4177,7 @@ void Item_user_var_as_out_param::set_val
CHARSET_INFO* cs)
{
if (::update_hash(entry, FALSE, (void*)str, length, STRING_RESULT, cs,
- DERIVATION_IMPLICIT))
+ DERIVATION_IMPLICIT, 0 /* unsigned_arg */))
current_thd->fatal_error(); // Probably end of memory
}
--- 1.144/sql/item_func.h 2006-08-03 09:33:03 +02:00
+++ 1.145/sql/item_func.h 2006-08-03 09:33:03 +02:00
@@ -1161,8 +1161,6 @@ class Item_func_set_user_var :public Ite
String *vstr;
my_decimal *vdec;
} save_result;
- String save_buff;
-
public:
LEX_STRING name; // keep it public
@@ -1173,8 +1171,8 @@ public:
longlong val_int();
String *val_str(String *str);
my_decimal *val_decimal(my_decimal *);
- bool update_hash(void *ptr, uint length, enum Item_result type,
- CHARSET_INFO *cs, Derivation dv);
+ bool update_hash(void *ptr, uint length, enum Item_result type,
+ CHARSET_INFO *cs, Derivation dv, bool unsigned_arg= 0);
bool check();
bool update();
enum Item_result result_type () const { return cached_result_type; }
--- 1.278/sql/item_strfunc.cc 2006-08-03 09:33:03 +02:00
+++ 1.279/sql/item_strfunc.cc 2006-08-03 09:33:03 +02:00
@@ -1503,6 +1503,23 @@ void Item_func_trim::fix_length_and_dec(
}
}
+void Item_func_trim::print(String *str)
+{
+ if (arg_count == 1)
+ {
+ Item_func::print(str);
+ return;
+ }
+ str->append(Item_func_trim::func_name());
+ str->append('(');
+ str->append(mode_name());
+ str->append(' ');
+ args[1]->print(str);
+ str->append(STRING_WITH_LEN(" from "));
+ args[0]->print(str);
+ str->append(')');
+}
+
/* Item_func_password */
--- 1.112/sql/item_strfunc.h 2006-08-03 09:33:03 +02:00
+++ 1.113/sql/item_strfunc.h 2006-08-03 09:33:03 +02:00
@@ -808,7 +808,7 @@ class Item_func_uncompress: public Item_
String buffer;
public:
Item_func_uncompress(Item *a): Item_str_func(a){}
- void fix_length_and_dec(){max_length= MAX_BLOB_WIDTH;}
+ void fix_length_and_dec(){ maybe_null= 1; max_length= MAX_BLOB_WIDTH; }
const char *func_name() const{return "uncompress";}
String *val_str(String *) ZLIB_DEPENDED_FUNCTION
};
--- 1.178/sql/item_sum.cc 2006-08-03 09:33:03 +02:00
+++ 1.179/sql/item_sum.cc 2006-08-03 09:33:03 +02:00
@@ -377,7 +377,13 @@ Field *Item_sum::create_tmp_field(bool g
case INT_RESULT:
return new Field_longlong(max_length,maybe_null,name,table,unsigned_flag);
case STRING_RESULT:
- if (max_length/collation.collation->mbmaxlen > 255 && convert_blob_length)
+ /*
+ Make sure that the blob fits into a Field_varstring which has
+ 2-byte lenght.
+ */
+ if (max_length/collation.collation->mbmaxlen > 255 &&
+ max_length/collation.collation->mbmaxlen < UINT_MAX16 &&
+ convert_blob_length)
return new Field_varstring(convert_blob_length, maybe_null,
name, table,
collation.collation);
--- 1.477/sql/sql_yacc.yy 2006-08-03 09:33:04 +02:00
+++ 1.478/sql/sql_yacc.yy 2006-08-03 09:33:04 +02:00
@@ -1256,6 +1256,17 @@ create_function_tail:
RETURNS_SYM udf_type UDF_SONAME_SYM TEXT_STRING_sys
{
LEX *lex=Lex;
+ if (lex->definer != NULL)
+ {
+ /*
+ DEFINER is a concept meaningful when interpreting SQL code.
+ UDF functions are compiled.
+ Using DEFINER with UDF has therefore no semantic,
+ and is considered a parsing error.
+ */
+ my_error(ER_WRONG_USAGE, MYF(0), "SONAME", "DEFINER");
+ YYABORT;
+ }
lex->sql_command = SQLCOM_CREATE_FUNCTION;
lex->udf.name = lex->spname->m_name;
lex->udf.returns=(Item_result) $2;
@@ -1285,6 +1296,7 @@ create_function_tail:
sp= new sp_head();
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
+ sp->init_sp_name(YYTHD, lex->spname);
sp->m_type= TYPE_ENUM_FUNCTION;
lex->sphead= sp;
@@ -1339,7 +1351,7 @@ create_function_tail:
YYABORT;
lex->sql_command= SQLCOM_CREATE_SPFUNCTION;
- sp->init_strings(YYTHD, lex, lex->spname);
+ sp->init_strings(YYTHD, lex);
if (!(sp->m_flags & sp_head::HAS_RETURN))
{
my_error(ER_SP_NORETURN, MYF(0), sp->m_qname.str);
@@ -1911,9 +1923,12 @@ sp_proc_stmt:
sp_instr_stmt *i=new sp_instr_stmt(sp->instructions(),
lex->spcont, lex);
- /* Extract the query statement from the tokenizer:
- The end is either lex->tok_end or tok->ptr. */
- if (lex->ptr - lex->tok_end > 1)
+ /*
+ Extract the query statement from the tokenizer. The
+ end is either lex->ptr, if there was no lookahead,
+ lex->tok_end otherwise.
+ */
+ if (yychar == YYEMPTY)
i->m_query.length= lex->ptr - sp->m_tmp_query;
else
i->m_query.length= lex->tok_end - sp->m_tmp_query;
@@ -7822,7 +7837,12 @@ option_type_value:
lex)))
YYABORT;
- if (lex->ptr - lex->tok_end > 1)
+ /*
+ Extract the query statement from the tokenizer. The
+ end is either lex->ptr, if there was no lookahead,
+ lex->tok_end otherwise.
+ */
+ if (yychar == YYEMPTY)
qbuff.length= lex->ptr - sp->m_tmp_query;
else
qbuff.length= lex->tok_end - sp->m_tmp_query;
@@ -8997,11 +9017,11 @@ view_algorithm_opt:
view_suid:
/* empty */
- { Lex->create_view_suid= TRUE; }
+ { Lex->create_view_suid= VIEW_SUID_DEFAULT; }
| SQL_SYM SECURITY_SYM DEFINER_SYM
- { Lex->create_view_suid= TRUE; }
+ { Lex->create_view_suid= VIEW_SUID_DEFINER; }
| SQL_SYM SECURITY_SYM INVOKER_SYM
- { Lex->create_view_suid= FALSE; }
+ { Lex->create_view_suid= VIEW_SUID_INVOKER; }
;
view_tail:
@@ -9092,6 +9112,7 @@ trigger_tail:
YYABORT;
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
+ sp->init_sp_name(YYTHD, $3);
lex->stmt_definition_begin= $2;
lex->ident.str= $7;
@@ -9120,7 +9141,7 @@ trigger_tail:
sp_head *sp= lex->sphead;
lex->sql_command= SQLCOM_CREATE_TRIGGER;
- sp->init_strings(YYTHD, lex, $3);
+ sp->init_strings(YYTHD, lex);
/* Restore flag if it was cleared above */
if (sp->m_old_cmq)
YYTHD->client_capabilities |= CLIENT_MULTI_QUERIES;
@@ -9168,13 +9189,14 @@ sp_tail:
my_error(ER_SP_NO_RECURSIVE_CREATE, MYF(0), "PROCEDURE");
YYABORT;
}
-
+
lex->stmt_definition_begin= $2;
-
+
/* Order is important here: new - reset - init */
sp= new sp_head();
sp->reset_thd_mem_root(YYTHD);
sp->init(lex);
+ sp->init_sp_name(YYTHD, $3);
sp->m_type= TYPE_ENUM_PROCEDURE;
lex->sphead= sp;
@@ -9212,7 +9234,7 @@ sp_tail:
LEX *lex= Lex;
sp_head *sp= lex->sphead;
- sp->init_strings(YYTHD, lex, $3);
+ sp->init_strings(YYTHD, lex);
lex->sql_command= SQLCOM_CREATE_PROCEDURE;
/* Restore flag if it was cleared above */
if (sp->m_old_cmq)
--- 1.83/mysql-test/r/union.result 2006-08-03 09:33:04 +02:00
+++ 1.84/mysql-test/r/union.result 2006-08-03 09:33:04 +02:00
@@ -691,9 +691,9 @@ t1 CREATE TABLE `t1` (
`da` datetime default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-create table t1 SELECT dt from t2 UNION select sc from t2;
-select * from t1;
-dt
+create table t1 SELECT dt from t2 UNION select trim(sc) from t2;
+select trim(dt) from t1;
+trim(dt)
1972-10-22 11:50:00
testc
show create table t1;
@@ -732,7 +732,7 @@ tetetetetest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` longblob
+ `dt` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT sv from t2 UNION select b from t2;
@@ -743,7 +743,7 @@ tetetetetest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `sv` longblob
+ `sv` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT i from t2 UNION select d from t2 UNION select b from t2;
@@ -755,7 +755,7 @@ tetetetetest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `i` longblob
+ `i` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT sv from t2 UNION select tx from t2;
@@ -766,7 +766,7 @@ teeeeeeeeeeeest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `sv` longtext
+ `sv` text
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT b from t2 UNION select tx from t2;
@@ -777,7 +777,7 @@ teeeeeeeeeeeest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `b` longblob
+ `b` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create table t1 select 1 union select -1;
@@ -1306,6 +1306,21 @@ id
5
99
drop table t1;
+create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp, f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
+create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `f1` char(1) default NULL,
+ `f2` char(5) default NULL,
+ `f3` binary(1) default NULL,
+ `f4` binary(5) default NULL,
+ `f5` timestamp NOT NULL default '0000-00-00 00:00:00',
+ `f6` varchar(1) character set utf8 default NULL,
+ `f7` text,
+ `f8` text character set utf8
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2;
(select avg(1)) union (select avg(1)) union (select avg(1)) union
(select avg(1)) union (select avg(1)) union (select avg(1)) union
(select avg(1)) union (select avg(1)) union (select avg(1)) union
--- 1.96/mysql-test/t/union.test 2006-08-03 09:33:04 +02:00
+++ 1.97/mysql-test/t/union.test 2006-08-03 09:33:04 +02:00
@@ -390,8 +390,8 @@ create table t1 SELECT da from t2 UNION
select * from t1;
show create table t1;
drop table t1;
-create table t1 SELECT dt from t2 UNION select sc from t2;
-select * from t1;
+create table t1 SELECT dt from t2 UNION select trim(sc) from t2;
+select trim(dt) from t1;
show create table t1;
drop table t1;
create table t1 SELECT dt from t2 UNION select sv from t2;
@@ -793,6 +793,14 @@ select id from t1 union all select 99 or
drop table t1;
# End of 4.1 tests
+
+#
+# Bug#12185: Data type aggregation may produce wrong result
+#
+create table t1(f1 char(1), f2 char(5), f3 binary(1), f4 binary(5), f5 timestamp, f6 varchar(1) character set utf8 collate utf8_general_ci, f7 text);
+create table t2 as select *, f6 as f8 from t1 union select *, f7 from t1;
+show create table t2;
+drop table t1, t2;
#
# Bug#18175: Union select over 129 tables with a sum function fails.
--- 1.129/sql/item_subselect.cc 2006-08-03 09:33:04 +02:00
+++ 1.130/sql/item_subselect.cc 2006-08-03 09:33:04 +02:00
@@ -1511,6 +1511,7 @@ static Item_result set_row(List<Item> &i
item->max_length= sel_item->max_length;
res_type= sel_item->result_type();
item->decimals= sel_item->decimals;
+ item->unsigned_flag= sel_item->unsigned_flag;
*maybe_null= sel_item->maybe_null;
if (!(row[i]= Item_cache::get_cache(res_type)))
return STRING_RESULT; // we should return something
--- 1.108/mysql-test/mysql-test-run.pl 2006-08-03 09:33:04 +02:00
+++ 1.109/mysql-test/mysql-test-run.pl 2006-08-03 09:33:04 +02:00
@@ -2912,12 +2912,16 @@ sub im_stop($) {
while (1)
{
+ # Check that IM-main died.
+
if (kill (0, $instance_manager->{'pid'}))
{
mtr_debug("IM-main is still alive.");
last;
}
+ # Check that IM-angel died.
+
if (defined $instance_manager->{'angel_pid'} &&
kill (0, $instance_manager->{'angel_pid'}))
{
@@ -2925,21 +2929,39 @@ sub im_stop($) {
last;
}
+ # Check that all guarded mysqld-instances died.
+
+ my $guarded_mysqlds_dead= 1;
+
foreach my $pid (@mysqld_pids)
{
if (kill (0, $pid))
{
mtr_debug("Guarded mysqld ($pid) is still alive.");
+ $guarded_mysqlds_dead= 0;
last;
}
}
+ last unless $guarded_mysqlds_dead;
+
+ # Ok, all necessary processes are dead.
+
$clean_shutdown= 1;
last;
}
# Kill leftovers (the order is important).
+ if ($clean_shutdown)
+ {
+ mtr_debug("IM-shutdown was clean -- all processed died.");
+ }
+ else
+ {
+ mtr_debug("IM failed to shutdown gracefully. We have to clean the mess...");
+ }
+
unless ($clean_shutdown)
{
@@ -2960,17 +2982,24 @@ sub im_stop($) {
mtr_kill_processes(\@mysqld_pids);
# Complain in error log so that a warning will be shown.
-
- my $errlog= "$opt_vardir/log/mysql-test-run.pl.err";
-
- open (ERRLOG, ">>$errlog") ||
- mtr_error("Can not open error log ($errlog)");
+ #
+ # TODO: unless BUG#20761 is fixed, we will print the warning
+ # to stdout, so that it can be seen on console and does not
+ # produce pushbuild error.
+
+ # my $errlog= "$opt_vardir/log/mysql-test-run.pl.err";
+ #
+ # open (ERRLOG, ">>$errlog") ||
+ # mtr_error("Can not open error log ($errlog)");
+ #
+ # my $ts= localtime();
+ # print ERRLOG
+ # "Warning: [$ts] Instance Manager did not shutdown gracefully.\n";
+ #
+ # close ERRLOG;
my $ts= localtime();
- print ERRLOG
- "Warning: [$ts] Instance Manager did not shutdown gracefully.\n";
-
- close ERRLOG;
+ print "Warning: [$ts] Instance Manager did not shutdown gracefully.\n";
}
# That's all.
--- 1.48/mysql-test/r/func_group.result 2006-08-03 09:33:04 +02:00
+++ 1.49/mysql-test/r/func_group.result 2006-08-03 09:33:04 +02:00
@@ -988,6 +988,17 @@ SUM(a)
6
DROP TABLE t1;
set div_precision_increment= @sav_dpi;
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+SELECT SQL_NO_CACHE
+(SELECT SUM(c.a) FROM t1 ttt, t2 ccc
+WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid
+FROM t1 t, t2 c WHERE t.a = c.b;
+minid
+NULL
+DROP TABLE t1,t2;
create table t1 select variance(0);
show create table t1;
Table Create Table
--- 1.47/mysql-test/t/func_group.test 2006-08-03 09:33:04 +02:00
+++ 1.48/mysql-test/t/func_group.test 2006-08-03 09:33:04 +02:00
@@ -661,6 +661,22 @@ DROP TABLE t1;
set div_precision_increment= @sav_dpi;
#
+# Bug #20868: Client connection is broken on SQL query error
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2);
+
+CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
+INSERT INTO t2 VALUES (1,1), (3,3);
+
+SELECT SQL_NO_CACHE
+ (SELECT SUM(c.a) FROM t1 ttt, t2 ccc
+ WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid
+FROM t1 t, t2 c WHERE t.a = c.b;
+
+DROP TABLE t1,t2;
+
+#
# Bug #10966: Variance functions return wrong data type
#
@@ -670,4 +686,4 @@ drop table t1;
create table t1 select stddev(0);
show create table t1;
drop table t1;
-
\ No newline at end of file
+
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2233) | msvensson | 3 Aug |