Commit c0711619 authored by unknown's avatar unknown

Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new

into serg.mylan:/usr/home/serg/Abk/mysql-5.1


client/mysqltest.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/binary.result:
  Auto merged
mysql-test/r/federated.result:
  Auto merged
mysql-test/r/func_math.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/heap.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/type_decimal.result:
  Auto merged
mysql-test/t/binary.test:
  Auto merged
mysql-test/t/federated.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/ha_federated.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
parents dd42550b 570f3281
......@@ -134,6 +134,137 @@ autom4te.cache/*
autom4te.cache/output.0
autom4te.cache/requests
autom4te.cache/traces.0
bdb/*.ds?
bdb/*.vcproj
bdb/README
bdb/btree/btree_auto.c
bdb/build_unix/*
bdb/build_vxworks/db.h
bdb/build_vxworks/db_int.h
bdb/build_win32/db.h
bdb/build_win32/db_archive.dsp
bdb/build_win32/db_checkpoint.dsp
bdb/build_win32/db_config.h
bdb/build_win32/db_cxx.h
bdb/build_win32/db_deadlock.dsp
bdb/build_win32/db_dll.dsp
bdb/build_win32/db_dump.dsp
bdb/build_win32/db_int.h
bdb/build_win32/db_java.dsp
bdb/build_win32/db_load.dsp
bdb/build_win32/db_perf.dsp
bdb/build_win32/db_printlog.dsp
bdb/build_win32/db_recover.dsp
bdb/build_win32/db_stat.dsp
bdb/build_win32/db_static.dsp
bdb/build_win32/db_tcl.dsp
bdb/build_win32/db_test.dsp
bdb/build_win32/db_upgrade.dsp
bdb/build_win32/db_verify.dsp
bdb/build_win32/ex_access.dsp
bdb/build_win32/ex_btrec.dsp
bdb/build_win32/ex_env.dsp
bdb/build_win32/ex_lock.dsp
bdb/build_win32/ex_mpool.dsp
bdb/build_win32/ex_tpcb.dsp
bdb/build_win32/excxx_access.dsp
bdb/build_win32/excxx_btrec.dsp
bdb/build_win32/excxx_env.dsp
bdb/build_win32/excxx_lock.dsp
bdb/build_win32/excxx_mpool.dsp
bdb/build_win32/excxx_tpcb.dsp
bdb/build_win32/include.tcl
bdb/build_win32/libdb.def
bdb/build_win32/libdb.rc
bdb/db/crdel_auto.c
bdb/db/db_auto.c
bdb/dbinc_auto/*.*
bdb/dbreg/dbreg_auto.c
bdb/dist/autom4te-2.53.cache/*
bdb/dist/autom4te-2.53.cache/output.0
bdb/dist/autom4te-2.53.cache/requests
bdb/dist/autom4te-2.53.cache/traces.0
bdb/dist/autom4te.cache/*
bdb/dist/autom4te.cache/output.0
bdb/dist/autom4te.cache/requests
bdb/dist/autom4te.cache/traces.0
bdb/dist/config.hin
bdb/dist/configure
bdb/dist/tags
bdb/dist/template/db_server_proc
bdb/dist/template/gen_client_ret
bdb/dist/template/rec_btree
bdb/dist/template/rec_crdel
bdb/dist/template/rec_db
bdb/dist/template/rec_dbreg
bdb/dist/template/rec_fileops
bdb/dist/template/rec_hash
bdb/dist/template/rec_log
bdb/dist/template/rec_qam
bdb/dist/template/rec_txn
bdb/examples_c/ex_apprec/ex_apprec_auto.c
bdb/examples_c/ex_apprec/ex_apprec_auto.h
bdb/examples_c/ex_apprec/ex_apprec_template
bdb/examples_java
bdb/fileops/fileops_auto.c
bdb/hash/hash_auto.c
bdb/include/btree_auto.h
bdb/include/btree_ext.h
bdb/include/clib_ext.h
bdb/include/common_ext.h
bdb/include/crdel_auto.h
bdb/include/db_auto.h
bdb/include/db_ext.h
bdb/include/db_server.h
bdb/include/env_ext.h
bdb/include/gen_client_ext.h
bdb/include/gen_server_ext.h
bdb/include/hash_auto.h
bdb/include/hash_ext.h
bdb/include/lock_ext.h
bdb/include/log_auto.h
bdb/include/log_ext.h
bdb/include/mp_ext.h
bdb/include/mutex_ext.h
bdb/include/os_ext.h
bdb/include/qam_auto.h
bdb/include/qam_ext.h
bdb/include/rpc_client_ext.h
bdb/include/rpc_server_ext.h
bdb/include/tcl_ext.h
bdb/include/txn_auto.h
bdb/include/txn_ext.h
bdb/include/xa_ext.h
bdb/java/src/com/sleepycat/db/Db.java
bdb/java/src/com/sleepycat/db/DbBtreeStat.java
bdb/java/src/com/sleepycat/db/DbConstants.java
bdb/java/src/com/sleepycat/db/DbHashStat.java
bdb/java/src/com/sleepycat/db/DbLockStat.java
bdb/java/src/com/sleepycat/db/DbLogStat.java
bdb/java/src/com/sleepycat/db/DbMpoolFStat.java
bdb/java/src/com/sleepycat/db/DbQueueStat.java
bdb/java/src/com/sleepycat/db/DbRepStat.java
bdb/java/src/com/sleepycat/db/DbTxnStat.java
bdb/libdb_java/java_stat_auto.c
bdb/libdb_java/java_stat_auto.h
bdb/log/log_auto.c
bdb/qam/qam_auto.c
bdb/rpc_client/db_server_clnt.c
bdb/rpc_client/gen_client.c
bdb/rpc_server/c/db_server_proc.c
bdb/rpc_server/c/db_server_proc.sed
bdb/rpc_server/c/db_server_svc.c
bdb/rpc_server/c/db_server_xdr.c
bdb/rpc_server/c/gen_db_server.c
bdb/rpc_server/db_server.x
bdb/rpc_server/db_server_proc.sed
bdb/rpc_server/db_server_svc.c
bdb/rpc_server/db_server_xdr.c
bdb/rpc_server/gen_db_server.c
bdb/test/TESTS
bdb/test/include.tcl
bdb/test/logtrack.list
bdb/txn/txn_auto.c
binary/*
bkpull.log
bkpull.log*
......@@ -253,6 +384,7 @@ include/my_global.h
include/mysql_version.h
include/mysqld_ername.h
include/mysqld_error.h
include/openssl
include/readline
include/readline/*.h
include/readline/readline.h
......@@ -396,6 +528,7 @@ libmysqld/opt_range.cc
libmysqld/opt_sum.cc
libmysqld/pack.c
libmysqld/parse_file.cc
libmysqld/partition_info.cc
libmysqld/password.c
libmysqld/procedure.cc
libmysqld/protocol.cc
......@@ -1383,6 +1516,7 @@ storage/ndb/src/common/mgmcommon/printConfig/*.d
storage/ndb/src/common/portlib/libportlib.dsp
storage/ndb/src/common/transporter/libtransporter.dsp
storage/ndb/src/common/util/libgeneral.dsp
storage/ndb/src/common/util/testBitmask.cpp
storage/ndb/src/cw/cpcd/ndb_cpcd
storage/ndb/src/dummy.cpp
storage/ndb/src/kernel/blocks/backup/libbackup.dsp
......@@ -1614,6 +1748,3 @@ vio/viotest-sslconnect.cpp
vio/viotest.cpp
zlib/*.ds?
zlib/*.vcproj
libmysqld/partition_info.cc
storage/ndb/src/common/util/testBitmask.cpp
include/openssl
......@@ -38,6 +38,7 @@ int check_user(THD *thd, enum enum_server_command command,
const char *passwd, uint passwd_len, const char *db,
bool check_count);
C_MODE_START
#include <mysql.h>
#undef ER
#include "errmsg.h"
......@@ -46,22 +47,6 @@ C_MODE_START
static my_bool emb_read_query_result(MYSQL *mysql);
C_MODE_END
void THD::clear_data_list()
{
while (first_data)
{
MYSQL_DATA *data= first_data;
first_data= data->embedded_info->next;
free_rows(data);
}
data_tail= &first_data;
free_rows(cur_data);
cur_data= 0;
}
C_MODE_START
/*
Reads error information from the MYSQL_DATA and puts
......@@ -426,15 +411,6 @@ MYSQL_METHODS embedded_methods=
emb_read_rows_from_cursor
};
C_MODE_END
void THD::clear_error()
{
net.last_error[0]= 0;
net.last_errno= 0;
net.report_error= 0;
}
/*
Make a copy of array and the strings array points to
*/
......@@ -461,11 +437,7 @@ char **copy_arguments(int argc, char **argv)
return res;
}
extern "C"
{
char ** copy_arguments_ptr= 0;
char ** copy_arguments_ptr= 0;
int init_embedded_server(int argc, char **argv, char **groups)
{
......@@ -580,9 +552,7 @@ void end_embedded_server()
clean_up(0);
}
} /* extern "C" */
C_MODE_START
void init_embedded_mysql(MYSQL *mysql, int client_flag, char *db)
{
THD *thd = (THD *)mysql->thd;
......@@ -701,6 +671,26 @@ int check_embedded_connection(MYSQL *mysql)
C_MODE_END
void THD::clear_data_list()
{
while (first_data)
{
MYSQL_DATA *data= first_data;
first_data= data->embedded_info->next;
free_rows(data);
}
data_tail= &first_data;
free_rows(cur_data);
cur_data= 0;
}
void THD::clear_error()
{
net.last_error[0]= 0;
net.last_errno= 0;
net.report_error= 0;
}
static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length,
CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
{
......
......@@ -15,6 +15,20 @@ select 4;
4
4
drop table t1;
kill (select count(*) from mysql.user);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*) from mysql.user)' at line 1
create table t1 (id int primary key);
create table t2 (id int unsigned not null);
insert into t2 select id from t1;
create table t3 (kill_id int);
insert into t3 values(connection_id());
select id from t1 where id in (select distinct id from t2);
select ((@id := kill_id) - kill_id) from t3;
((@id := kill_id) - kill_id)
0
kill @id;
Got one of the listed errors
drop table t1, t2, t3;
create table t1 (id int primary key);
create table t2 (id int unsigned not null);
insert into t2 select id from t1;
......
......@@ -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
......
......@@ -46,8 +46,12 @@ select @id != connection_id();
connection con2;
select 4;
drop table t1;
connection default;
disconnect con2;
--error 1064
kill (select count(*) from mysql.user);
#
# BUG#14851: killing long running subquery processed via a temporary table.
#
......
......@@ -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,
......
......@@ -7176,9 +7176,8 @@ select_derived2:
{
LEX *lex= Lex;
lex->derived_tables|= DERIVED_SUBQUERY;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL)
if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command == (int)SQLCOM_KILL)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
......@@ -8673,18 +8672,18 @@ purge_option:
/* kill threads */
kill:
KILL_SYM kill_option expr
KILL_SYM { Lex->sql_command= SQLCOM_KILL; } kill_option expr
{
LEX *lex=Lex;
lex->value_list.empty();
lex->value_list.push_front($3);
lex->sql_command= SQLCOM_KILL;
lex->value_list.push_front($4);
};
kill_option:
/* empty */ { Lex->type= 0; }
| CONNECTION_SYM { Lex->type= 0; }
| QUERY_SYM { Lex->type= ONLY_KILL_QUERY; };
| QUERY_SYM { Lex->type= ONLY_KILL_QUERY; }
;
/* change database */
......@@ -8697,7 +8696,7 @@ use: USE_SYM ident
/* import, export of files */
load: LOAD DATA_SYM
load: LOAD DATA_SYM
{
LEX *lex=Lex;
if (lex->sphead)
......@@ -10765,9 +10764,8 @@ subselect_start:
'(' SELECT_SYM
{
LEX *lex=Lex;
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL)
if (lex->sql_command == (int)SQLCOM_HA_READ ||
lex->sql_command == (int)SQLCOM_KILL)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
......
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