Commit 394da857 authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0

into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
parents 1e028904 b65fbcbc
......@@ -1180,8 +1180,6 @@ static void do_exec(struct st_query *query)
("error: %d, status: %d", error, status));
for (i= 0; i < query->expected_errors; i++)
{
DBUG_PRINT("info",
("error: %d, status: %d", error, status));
DBUG_PRINT("info", ("expected error: %d",
query->expected_errno[i].code.errnum));
if ((query->expected_errno[i].type == ERR_ERRNO) &&
......@@ -1413,6 +1411,35 @@ int do_modify_var(struct st_query *query, const char *name,
}
/*
Wrapper for 'system' function
NOTE
If mysqltest is executed from cygwin shell, the command will be
executed in the "windows command interpreter" cmd.exe and we prepend "sh"
to make it be executed by cygwins "bash". Thus commands like "rm",
"mkdir" as well as shellscripts can executed by "system" in Windows.
*/
int my_system(DYNAMIC_STRING* ds_cmd)
{
#ifdef __WIN__
/* Dump the command into a sh script file and execute with "sh" */
int err;
char tmp_sh_name[64], tmp_sh_cmd[70];
my_snprintf(tmp_sh_name, sizeof(tmp_sh_name), "tmp_%d.sh", getpid());
my_snprintf(tmp_sh_cmd, sizeof(tmp_sh_cmd), "sh %s", tmp_sh_name);
str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
err= system(tmp_sh_cmd);
my_delete(tmp_sh_name, MYF(0));
return err;
#else
return system(ds_cmd->str);
#endif
}
/*
SYNOPSIS
......@@ -1425,14 +1452,12 @@ int do_modify_var(struct st_query *query, const char *name,
Eval the query to expand any $variables in the command.
Execute the command with the "system" command.
NOTE
If mysqltest is executed from cygwin shell, the command will be
executed in cygwin shell. Thus commands like "rm" etc can be used.
*/
*/
int do_system(struct st_query *command)
void do_system(struct st_query *command)
{
DYNAMIC_STRING ds_cmd;
DBUG_ENTER("do_system");
if (strlen(command->first_argument) == 0)
die("Missing arguments to system, nothing to do!");
......@@ -1444,7 +1469,7 @@ int do_system(struct st_query *command)
DBUG_PRINT("info", ("running system command '%s' as '%s'",
command->first_argument, ds_cmd.str));
if (system(ds_cmd.str))
if (my_system(&ds_cmd))
{
if (command->abort_on_error)
die("system command '%s' failed", command->first_argument);
......@@ -1456,7 +1481,7 @@ int do_system(struct st_query *command)
}
command->last_argument= command->end;
return 0;
DBUG_VOID_RETURN;
}
......@@ -1795,6 +1820,7 @@ int do_sleep(struct st_query *query, my_bool real_sleep)
char *p= query->first_argument;
char *sleep_start, *sleep_end= query->end;
double sleep_val;
const char *cmd = (real_sleep ? "real_sleep" : "sleep");
while (my_isspace(charset_info, *p))
p++;
......@@ -2764,7 +2790,7 @@ int do_done(struct st_query *q)
*/
int do_block(enum block_cmd cmd, struct st_query* q)
void do_block(enum block_cmd cmd, struct st_query* q)
{
char *p= q->first_argument;
const char *expr_start, *expr_end;
......@@ -2788,7 +2814,7 @@ int do_block(enum block_cmd cmd, struct st_query* q)
cur_block++;
cur_block->cmd= cmd;
cur_block->ok= FALSE;
return 0;
DBUG_VOID_RETURN;
}
/* Parse and evaluate test expression */
......@@ -3704,7 +3730,7 @@ static void init_win_path_patterns()
static void free_win_path_patterns()
{
int i= 0;
uint i= 0;
for (i=0 ; i < patterns.elements ; i++)
{
const char** pattern= dynamic_element(&patterns, i, const char**);
......
......@@ -96,7 +96,16 @@ sub mtr_exe_exists (@) {
map {$_.= ".exe"} @path if $::glob_win32;
foreach my $path ( @path )
{
return $path if -x $path;
if ( -x $path )
{
if ( $::glob_cygwin_perl )
{
$path= `cygpath -w $path`;
# Chop off the \n that cygpath adds
$path=~ s/\n//;
}
return $path;
}
}
if ( @path == 1 )
{
......
......@@ -703,6 +703,9 @@ sub command_line_setup () {
$opt_vardir= "$glob_mysql_test_dir/var";
}
$opt_vardir_trace= $opt_vardir;
# Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/...
$opt_vardir_trace=~ s/^\w://;
# We make the path absolute, as the server will do a chdir() before usage
unless ( $opt_vardir =~ m,^/, or
($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
......
......@@ -1185,6 +1185,16 @@ select concat('value is: ', @val) union select 'some text';
concat('value is: ', @val)
value is: 6
some text
select concat(_latin1'a', _ascii'b' collate ascii_bin);
concat(_latin1'a', _ascii'b' collate ascii_bin)
ab
create table t1 (foo varchar(100)) collate ascii_bin;
insert into t1 (foo) values ("foo");
select foo from t1 union select 'bar' as foo from dual;
foo
foo
bar
drop table t1;
CREATE TABLE t1 (
a ENUM('','','') character set utf8 not null default '',
b ENUM("one", "two") character set utf8,
......@@ -1214,7 +1224,7 @@ Field Type Null Key Default Extra
a varchar(1) NO
drop table t2;
create table t2 select a from t1 union select c from t1;
ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION'
drop table t2;
create table t2 select a from t1 union select b from t1;
show columns from t2;
Field Type Null Key Default Extra
......
......@@ -840,8 +840,8 @@ DROP TABLE t1, t2;
# Bugs #9136, #12917: problems with --defaults-extra-file option
#
--system echo "[mysqltest1]" > $MYSQLTEST_VARDIR/tmp/tmp.cnf
--system echo "port=1234" >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
--system echo '[mysqltest1]' > $MYSQLTEST_VARDIR/tmp/tmp.cnf
--system echo 'port=1234' >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1
--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1
--system rm $MYSQLTEST_VARDIR/tmp/tmp.cnf
......
......@@ -707,6 +707,15 @@ drop table t1;
set @val:=6;
select concat('value is: ', @val) union select 'some text';
#
# Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE)
#
select concat(_latin1'a', _ascii'b' collate ascii_bin);
create table t1 (foo varchar(100)) collate ascii_bin;
insert into t1 (foo) values ("foo");
select foo from t1 union select 'bar' as foo from dual;
drop table t1;
#
# Enum merging test
#
......@@ -726,8 +735,8 @@ drop table t2;
create table t2 select a from t1 union select a from t1;
show columns from t2;
drop table t2;
-- error 1267
create table t2 select a from t1 union select c from t1;
drop table t2;
create table t2 select a from t1 union select b from t1;
show columns from t2;
drop table t2, t1;
......
......@@ -6020,7 +6020,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item)
const char *old_cs, *old_derivation;
old_cs= collation.collation->name;
old_derivation= collation.derivation_name();
if (collation.aggregate(item->collation))
if (collation.aggregate(item->collation, MY_COLL_ALLOW_CONV))
{
my_error(ER_CANT_AGGREGATE_2COLLATIONS, MYF(0),
old_cs, old_derivation,
......
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