Commit dad790f3 authored by unknown's avatar unknown

Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/M50/mysql-5.0


Build-tools/Do-compile:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
parents 1fbea39b dad8e1f5
......@@ -2352,16 +2352,10 @@ row_sel_store_mysql_rec(
byte* blob_buf;
int pad_char;
ulint i;
dict_index_t* index;
ut_ad(prebuilt->mysql_template);
ut_ad(rec_offs_validate(rec, NULL, offsets));
index = prebuilt->index;
if (prebuilt->need_to_access_clustered) {
index = dict_table_get_first_index(index->table);
}
if (prebuilt->blob_heap != NULL) {
mem_heap_free(prebuilt->blob_heap);
prebuilt->blob_heap = NULL;
......
......@@ -11,3 +11,4 @@ show create table func;
show create table tables_priv;
show create table columns_priv;
show create table procs_priv;
show create table proc;
......@@ -505,7 +505,7 @@ proc body blob
proc definer char(77)
proc created timestamp
proc modified timestamp
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO')
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE')
proc comment char(64)
drop table t115;
create procedure p108 () begin declare c cursor for select data_type
......
......@@ -889,3 +889,25 @@ a b a b
2 2 2 2
NULL NULL 3 3
DROP TABLE t0,t1,t2,t3;
CREATE TABLE t1 (a int PRIMARY KEY, b int);
CREATE TABLE t2 (a int PRIMARY KEY, b int);
INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2);
INSERT INTO t2 VALUES (1,2), (2,2);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
4 2 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
DROP TABLE t1,t2;
......@@ -957,3 +957,25 @@ drop table t1;
select table_name from information_schema.tables
where table_schema="test";
table_name
SET SESSION query_cache_type = 1;
set global query_cache_size=1024*1024;
flush query cache;
create table t1 ( a int );
insert into t1 values (1);
select a from t1;
a
1
select a from t1;
a
1
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
drop table t1;
set GLOBAL query_cache_size=0;
......@@ -154,5 +154,26 @@ procs_priv CREATE TABLE `procs_priv` (
PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
show create table proc;
Table Create Table
proc CREATE TABLE `proc` (
`db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
`name` char(64) NOT NULL default '',
`type` enum('FUNCTION','PROCEDURE') NOT NULL default 'FUNCTION',
`specific_name` char(64) NOT NULL default '',
`language` enum('SQL') NOT NULL default 'SQL',
`sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL default 'CONTAINS_SQL',
`is_deterministic` enum('YES','NO') NOT NULL default 'NO',
`security_type` enum('INVOKER','DEFINER') NOT NULL default 'DEFINER',
`param_list` blob NOT NULL,
`returns` char(64) NOT NULL default '',
`body` blob NOT NULL,
`definer` char(77) character set latin1 collate latin1_bin NOT NULL default '',
`created` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL default '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL default '',
`comment` char(64) character set latin1 collate latin1_bin NOT NULL default '',
PRIMARY KEY (`db`,`name`,`type`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Stored Procedures'
show tables;
Tables_in_test
......@@ -630,3 +630,22 @@ select * from t2 right join t1 on t2.a=t1.a;
select straight_join * from t2 right join t1 on t2.a=t1.a;
DROP TABLE t0,t1,t2,t3;
#
# Test for bug #9017: left join mistakingly converted to inner join
#
CREATE TABLE t1 (a int PRIMARY KEY, b int);
CREATE TABLE t2 (a int PRIMARY KEY, b int);
INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2);
INSERT INTO t2 VALUES (1,2), (2,2);
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a;
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
DROP TABLE t1,t2;
......@@ -697,3 +697,17 @@ where table_schema="test";
drop table t1;
select table_name from information_schema.tables
where table_schema="test";
# Bug #8480: REPAIR TABLE needs to flush the table from the query cache
SET SESSION query_cache_type = 1;
set global query_cache_size=1024*1024;
flush query cache;
create table t1 ( a int );
insert into t1 values (1);
select a from t1;
select a from t1;
show status like 'qcache_queries_in_cache';
repair table t1;
show status like 'qcache_queries_in_cache';
drop table t1;
set GLOBAL query_cache_size=0;
......@@ -702,7 +702,17 @@ then
c_p="$c_p 'MYSQL323',"
c_p="$c_p 'MYSQL40',"
c_p="$c_p 'ANSI',"
c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO'"
c_p="$c_p 'NO_AUTO_VALUE_ON_ZERO',"
c_p="$c_p 'NO_BACKSLASH_ESCAPES',"
c_p="$c_p 'STRICT_TRANS_TABLES',"
c_p="$c_p 'STRICT_ALL_TABLES',"
c_p="$c_p 'NO_ZERO_IN_DATE',"
c_p="$c_p 'NO_ZERO_DATE',"
c_p="$c_p 'INVALID_DATES',"
c_p="$c_p 'ERROR_FOR_DIVISION_BY_ZERO',"
c_p="$c_p 'TRADITIONAL',"
c_p="$c_p 'NO_AUTO_CREATE_USER',"
c_p="$c_p 'HIGH_NOT_PRECEDENCE'"
c_p="$c_p ) DEFAULT 0 NOT NULL,"
c_p="$c_p comment char(64) binary DEFAULT '' NOT NULL,"
c_p="$c_p PRIMARY KEY (db,name,type)"
......
......@@ -422,7 +422,17 @@ CREATE TABLE IF NOT EXISTS proc (
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO'
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT 0 NOT NULL,
comment char(64) binary DEFAULT '' NOT NULL,
PRIMARY KEY (db,name,type)
......@@ -436,4 +446,36 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
'NO_SQL',
'READS_SQL_DATA',
'MODIFIES_SQL_DATA'
) DEFAULT 'CONTAINS_SQL' NOT NULL;
) DEFAULT 'CONTAINS_SQL' NOT NULL,
MODIFY sql_mode
set('REAL_AS_FLOAT',
'PIPES_AS_CONCAT',
'ANSI_QUOTES',
'IGNORE_SPACE',
'NOT_USED',
'ONLY_FULL_GROUP_BY',
'NO_UNSIGNED_SUBTRACTION',
'NO_DIR_IN_CREATE',
'POSTGRESQL',
'ORACLE',
'MSSQL',
'DB2',
'MAXDB',
'NO_KEY_OPTIONS',
'NO_TABLE_OPTIONS',
'NO_FIELD_OPTIONS',
'MYSQL323',
'MYSQL40',
'ANSI',
'NO_AUTO_VALUE_ON_ZERO',
'NO_BACKSLASH_ESCAPES',
'STRICT_TRANS_TABLES',
'STRICT_ALL_TABLES',
'NO_ZERO_IN_DATE',
'NO_ZERO_DATE',
'INVALID_DATES',
'ERROR_FOR_DIVISION_BY_ZERO',
'TRADITIONAL',
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT 0 NOT NULL;
......@@ -194,6 +194,15 @@ parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysq
parse_arguments PICK-ARGS-FROM-ARGV "$@"
safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
# Make sure that directory for $safe_mysql_unix_port exists
mysql_unix_port_dir=`dirname $safe_mysql_unix_port`
if [ ! -d $mysql_unix_port_dir ]
then
mkdir $mysql_unix_port_dir
chown $user $mysql_unix_port_dir
fi
if test ! -x $ledir/$MYSQLD
then
echo "The file $ledir/$MYSQLD doesn't exist or is not executable"
......
......@@ -1234,6 +1234,7 @@ class Item_cond_xor :public Item_cond
enum Type type() const { return FUNC_ITEM; }
longlong val_int();
const char *func_name() const { return "xor"; }
table_map not_null_tables() const { return and_tables_cache; }
};
......
......@@ -299,6 +299,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
use strictly more than 64 bits by adding one more define above, you should
contact the replication team because the replication code should then be
updated (to store more bytes on disk).
NOTE: When adding new SQL_MODE types, make sure to also add them to
../scripts/mysql_create_system_tables.sh and
../scripts/mysql_fix_privilege_tables.sql
*/
#define RAID_BLOCK_SIZE 1024
......
......@@ -2144,7 +2144,9 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
thd->exit_cond(old_message);
if (thd->killed)
goto err;
open_for_modify=0;
/* Flush entries in the query cache involving this table. */
query_cache_invalidate3(thd, table->table, 0);
open_for_modify= 0;
}
result_code = (table->table->file->*operator_func)(thd, check_opt);
......
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