Below is the list of changes that have just been committed into a local
5.0 repository of tim. When tim 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-10-24 14:42:08-06:00, tsmith@stripped +18 -0
Merge siva.hindu.god:/usr/home/tim/m/bk/g50
into siva.hindu.god:/usr/home/tim/m/bk/50
MERGE: 1.2275.1.15
configure.in@stripped, 2006-10-24 14:31:04-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.399.1.1
myisam/sort.c@stripped, 2006-10-24 14:42:04-06:00, tsmith@stripped +1 -2
Manual merge
MERGE: 1.51.1.1
mysql-test/r/innodb_mysql.result@stripped, 2006-10-24 14:42:04-06:00, tsmith@stripped
+7 -6
Manual merge
MERGE: 1.9.1.3
mysql-test/r/rename.result@stripped, 2006-10-24 14:31:04-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.12.1.1
mysql-test/r/subselect.result@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.161.1.2
mysql-test/r/view.result@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.178.1.2
mysql-test/t/innodb_mysql.test@stripped, 2006-10-24 14:42:04-06:00, tsmith@stripped
+11 -7
Manual merge
MERGE: 1.8.1.1
mysql-test/t/subselect.test@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0
-0
Auto merged
MERGE: 1.129.1.1
mysql-test/t/view.test@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.166.1.2
mysys/mf_iocache.c@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.55.1.1
sql/item_func.cc@stripped, 2006-10-24 14:31:05-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.307.1.1
sql/opt_range.cc@stripped, 2006-10-24 14:31:06-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.229.1.1
sql/opt_range.h@stripped, 2006-10-24 14:31:06-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.63.1.1
sql/sql_lex.cc@stripped, 2006-10-24 14:31:06-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.201.1.1
sql/sql_lex.h@stripped, 2006-10-24 14:31:06-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.228.1.1
sql/sql_select.cc@stripped, 2006-10-24 14:31:07-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.458.6.2
sql/sql_table.cc@stripped, 2006-10-24 14:31:07-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.322.1.1
sql/table.cc@stripped, 2006-10-24 14:31:07-06:00, tsmith@stripped +0 -0
Auto merged
MERGE: 1.235.1.1
# 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: tsmith
# Host: siva.hindu.god
# Root: /usr/home/tim/m/bk/50/RESYNC
--- 1.402/configure.in 2006-10-24 14:42:20 -06:00
+++ 1.403/configure.in 2006-10-24 14:42:20 -06:00
@@ -1176,12 +1176,16 @@ EOF
cat > $filesed << EOF
s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
s,\(: conf_to_src\),\1.linux,
+s,libyassl.la,.libs/libyassl.a,
+s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
libmysql_r/Makefile.in)
cat > $filesed << EOF
s,\(\./conf_to_src\)\( \$(top_srcdir)\),\1.linux\2,
s,\(: conf_to_src\),\1.linux,
+s,libyassl.la,.libs/libyassl.a,
+s,libtaocrypt.la,.libs/libtaocrypt.a,
EOF
;;
strings/Makefile.in)
--- 1.53/myisam/sort.c 2006-10-24 14:42:20 -06:00
+++ 1.54/myisam/sort.c 2006-10-24 14:42:20 -06:00
@@ -327,7 +327,7 @@ pthread_handler_t thr_find_all_keys(void
if (sort_param->sort_info->got_error)
goto err;
- if (sort_param->keyinfo->flag && HA_VAR_LENGTH_KEY)
+ if (sort_param->keyinfo->flag & HA_VAR_LENGTH_KEY)
{
sort_param->write_keys= write_keys_varlen;
sort_param->read_to_buffer= read_to_buffer_varlen;
@@ -542,7 +542,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_p
{
if (got_error)
continue;
- if (sinfo->keyinfo->flag && HA_VAR_LENGTH_KEY)
+ if (sinfo->keyinfo->flag & HA_VAR_LENGTH_KEY)
{
sinfo->write_keys=write_keys_varlen;
sinfo->read_to_buffer=read_to_buffer_varlen;
--- 1.56/mysys/mf_iocache.c 2006-10-24 14:42:20 -06:00
+++ 1.57/mysys/mf_iocache.c 2006-10-24 14:42:20 -06:00
@@ -332,7 +332,11 @@ my_bool reinit_io_cache(IO_CACHE *info,
{
info->read_end=info->write_pos;
info->end_of_file=my_b_tell(info);
- info->seek_not_done=1;
+ /*
+ Trigger a new seek only if we have a valid
+ file handle.
+ */
+ info->seek_not_done= (info->file != -1);
}
else if (type == WRITE_CACHE)
{
--- 1.230/sql/opt_range.cc 2006-10-24 14:42:20 -06:00
+++ 1.231/sql/opt_range.cc 2006-10-24 14:42:20 -06:00
@@ -8376,6 +8376,7 @@ TRP_GROUP_MIN_MAX::make_quick(PARAM *par
quick->quick_prefix_select= NULL;
quick->update_key_stat();
+ quick->adjust_prefix_ranges();
DBUG_RETURN(quick);
}
@@ -8602,6 +8603,42 @@ bool QUICK_GROUP_MIN_MAX_SELECT::add_ran
if (insert_dynamic(&min_max_ranges, (gptr)&range))
return TRUE;
return FALSE;
+}
+
+
+/*
+ Opens the ranges if there are more conditions in quick_prefix_select than
+ the ones used for jumping through the prefixes.
+
+ SYNOPSIS
+ QUICK_GROUP_MIN_MAX_SELECT::adjust_prefix_ranges()
+
+ NOTES
+ quick_prefix_select is made over the conditions on the whole key.
+ It defines a number of ranges of length x.
+ However when jumping through the prefixes we use only the the first
+ few most significant keyparts in the range key. However if there
+ are more keyparts to follow the ones we are using we must make the
+ condition on the key inclusive (because x < "ab" means
+ x[0] < 'a' OR (x[0] == 'a' AND x[1] < 'b').
+ To achive the above we must turn off the NEAR_MIN/NEAR_MAX
+*/
+void QUICK_GROUP_MIN_MAX_SELECT::adjust_prefix_ranges ()
+{
+ if (quick_prefix_select &&
+ group_prefix_len < quick_prefix_select->max_used_key_length)
+ {
+ DYNAMIC_ARRAY *arr;
+ uint inx;
+
+ for (inx= 0, arr= &quick_prefix_select->ranges; inx < arr->elements;
inx++)
+ {
+ QUICK_RANGE *range;
+
+ get_dynamic(arr, (gptr)&range, inx);
+ range->flag &= ~(NEAR_MIN | NEAR_MAX);
+ }
+ }
}
--- 1.64/sql/opt_range.h 2006-10-24 14:42:20 -06:00
+++ 1.65/sql/opt_range.h 2006-10-24 14:42:20 -06:00
@@ -295,6 +295,7 @@ protected:
friend class QUICK_SELECT_DESC;
friend class QUICK_INDEX_MERGE_SELECT;
friend class QUICK_ROR_INTERSECT_SELECT;
+ friend class QUICK_GROUP_MIN_MAX_SELECT;
DYNAMIC_ARRAY ranges; /* ordered array of range ptrs */
QUICK_RANGE **cur_range; /* current element in ranges */
@@ -643,6 +644,7 @@ public:
~QUICK_GROUP_MIN_MAX_SELECT();
bool add_range(SEL_ARG *sel_range);
void update_key_stat();
+ void adjust_prefix_ranges();
bool alloc_buffers();
int init();
int reset();
--- 1.203/sql/sql_lex.cc 2006-10-24 14:42:20 -06:00
+++ 1.204/sql/sql_lex.cc 2006-10-24 14:42:20 -06:00
@@ -1138,7 +1138,7 @@ void st_select_lex::init_query()
initialization is checked for failure.
*/
parent_lex->push_context(&context);
- cond_count= with_wild= 0;
+ cond_count= between_count= with_wild= 0;
conds_processed_with_permanent_arena= 0;
ref_pointer_array= 0;
select_n_having_items= 0;
--- 1.230/sql/sql_lex.h 2006-10-24 14:42:20 -06:00
+++ 1.231/sql/sql_lex.h 2006-10-24 14:42:20 -06:00
@@ -530,7 +530,8 @@ public:
list during split_sum_func
*/
uint select_n_having_items;
- uint cond_count; /* number of arguments of and/or/xor in where/having */
+ uint cond_count; /* number of arguments of and/or/xor in where/having/on */
+ uint between_count; /* number of between predicates in where/having/on */
enum_parsing_place parsing_place; /* where we are parsing expression */
bool with_sum_func; /* sum function indicator */
/*
--- 1.467/sql/sql_select.cc 2006-10-24 14:42:20 -06:00
+++ 1.468/sql/sql_select.cc 2006-10-24 14:42:20 -06:00
@@ -11567,7 +11567,7 @@ part_of_refkey(TABLE *table,Field *field
for (uint part=0 ; part < ref_parts ; part++,key_part++)
if (field->eq(key_part->field) &&
- !(key_part->key_part_flag & HA_PART_KEY_SEG))
+ !(key_part->key_part_flag & (HA_PART_KEY_SEG | HA_NULL_PART)))
return table->reginfo.join_tab->ref.items[part];
}
return (Item*) 0;
--- 1.323/sql/sql_table.cc 2006-10-24 14:42:20 -06:00
+++ 1.324/sql/sql_table.cc 2006-10-24 14:42:20 -06:00
@@ -3155,9 +3155,10 @@ bool mysql_alter_table(THD *thd,char *ne
ha_rows copied,deleted;
ulonglong next_insert_id;
uint db_create_options, used_fields;
- enum db_type old_db_type,new_db_type;
+ enum db_type old_db_type, new_db_type, table_type;
bool need_copy_table;
bool no_table_reopen= FALSE, varchar= FALSE;
+ frm_type_enum frm_type;
DBUG_ENTER("mysql_alter_table");
thd->proc_info="init";
@@ -3176,6 +3177,51 @@ bool mysql_alter_table(THD *thd,char *ne
/* Conditionally writes to binlog. */
DBUG_RETURN(mysql_discard_or_import_tablespace(thd,table_list,
alter_info->tablespace_op));
+ sprintf(new_name_buff,"%s/%s/%s%s",mysql_data_home, db, table_name, reg_ext);
+ unpack_filename(new_name_buff, new_name_buff);
+ if (lower_case_table_names != 2)
+ my_casedn_str(files_charset_info, new_name_buff);
+ frm_type= mysql_frm_type(thd, new_name_buff, &table_type);
+ /* Rename a view */
+ if (frm_type == FRMTYPE_VIEW && !(alter_info->flags & ~ALTER_RENAME))
+ {
+ /*
+ Avoid problems with a rename on a table that we have locked or
+ if the user is trying to to do this in a transcation context
+ */
+
+ if (thd->locked_tables || thd->active_transaction())
+ {
+ my_message(ER_LOCK_OR_ACTIVE_TRANSACTION,
+ ER(ER_LOCK_OR_ACTIVE_TRANSACTION), MYF(0));
+ DBUG_RETURN(1);
+ }
+
+ if (wait_if_global_read_lock(thd,0,1))
+ DBUG_RETURN(1);
+ VOID(pthread_mutex_lock(&LOCK_open));
+ if (lock_table_names(thd, table_list))
+ goto view_err;
+
+ error=0;
+ if (!do_rename(thd, table_list, new_db, new_name, new_name, 1))
+ {
+ if (mysql_bin_log.is_open())
+ {
+ thd->clear_error();
+ Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE);
+ mysql_bin_log.write(&qinfo);
+ }
+ send_ok(thd);
+ }
+
+ unlock_table_names(thd, table_list, (TABLE_LIST*) 0);
+
+view_err:
+ pthread_mutex_unlock(&LOCK_open);
+ start_waiting_global_read_lock(thd);
+ DBUG_RETURN(error);
+ }
if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ)))
DBUG_RETURN(TRUE);
@@ -4051,7 +4097,7 @@ copy_data_between_tables(TABLE *from,TAB
if (thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
&tables, fields, all_fields, order) ||
- !(sortorder=make_unireg_sortorder(order, &length)) ||
+ !(sortorder=make_unireg_sortorder(order, &length, NULL)) ||
(from->sort.found_records = filesort(thd, from, sortorder, length,
(SQL_SELECT *) 0, HA_POS_ERROR,
&examined_rows)) ==
--- 1.237/sql/table.cc 2006-10-24 14:42:20 -06:00
+++ 1.238/sql/table.cc 2006-10-24 14:42:20 -06:00
@@ -834,7 +834,7 @@ int openfrm(THD *thd, const char *name,
as we need to test for NULL = NULL.
*/
if (field->real_maybe_null())
- key_part->key_part_flag|= HA_PART_KEY_SEG;
+ key_part->key_part_flag|= HA_NULL_PART;
}
else
{ // Error: shorten key
--- 1.10/mysql-test/r/innodb_mysql.result 2006-10-24 14:42:20 -06:00
+++ 1.11/mysql-test/r/innodb_mysql.result 2006-10-24 14:42:20 -06:00
@@ -104,6 +104,16 @@ SELECT `id1` FROM `t1` WHERE `id1` NOT I
id1
2
DROP TABLE t1, t2;
+flush status;
+create table t1 (c1 int) engine=innodb;
+handler t1 open;
+handler t1 read first;
+c1
+show /*!50002 GLOBAL */ status like 'Handler_rollback';
+Variable_name Value
+Handler_rollback 0
+drop table t1;
+End of 4.1 tests
create table t1m (a int) engine=myisam;
create table t1i (a int) engine=innodb;
create table t2m (a int) engine=myisam;
@@ -337,6 +347,12 @@ id select_type table type possible_keys
1 SIMPLE t2 index NULL fkey 5 NULL 5 Using index
1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.fkey 1 Using where
DROP TABLE t1,t2;
+create table t1(f1 varchar(800) binary not null, key(f1)) engine = innodb
+character set utf8 collate utf8_general_ci;
+Warnings:
+Warning 1071 Specified key was too long; max key length is 765 bytes
+insert into t1 values('aaa');
+drop table t1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
INSERT INTO t1 VALUES ( 1 , 1 , 1);
INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
@@ -353,3 +369,4 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c)
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
DROP TABLE t1;
+End of 5.0 tests
--- 1.10/mysql-test/t/innodb_mysql.test 2006-10-24 14:42:21 -06:00
+++ 1.11/mysql-test/t/innodb_mysql.test 2006-10-24 14:42:21 -06:00
@@ -326,3 +326,25 @@ create table t1(f1 varchar(800) binary n
character set utf8 collate utf8_general_ci;
insert into t1 values('aaa');
drop table t1;
+
+
+#
+# Bug#22781: SQL_BIG_RESULT fails to influence sort plan
+#
+CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c FLOAT, KEY b(b)) ENGINE = INNODB;
+
+INSERT INTO t1 VALUES ( 1 , 1 , 1);
+INSERT INTO t1 SELECT a + 1 , MOD(a + 1 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 2 , MOD(a + 2 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 4 , MOD(a + 4 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 8 , MOD(a + 8 , 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 16, MOD(a + 16, 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 32, MOD(a + 32, 20), 1 FROM t1;
+INSERT INTO t1 SELECT a + 64, MOD(a + 64, 20), 1 FROM t1;
+
+EXPLAIN SELECT b, SUM(c) FROM t1 GROUP BY b;
+EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
+DROP TABLE t1;
+
+
+--echo End of 5.0 tests
--- 1.163/mysql-test/r/subselect.result 2006-10-24 14:42:21 -06:00
+++ 1.164/mysql-test/r/subselect.result 2006-10-24 14:42:21 -06:00
@@ -363,12 +363,12 @@ INSERT INTO t8 (pseudo,email) VALUES ('j
INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1');
EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8
WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t8 ref PRIMARY PRIMARY 37 const 1 Using where; Using index
-4 SUBQUERY t8 ref PRIMARY PRIMARY 37 1 Using where; Using index
-2 SUBQUERY t8 ref PRIMARY PRIMARY 37 const 1 Using where
-3 SUBQUERY t8 ref PRIMARY PRIMARY 37 1 Using where; Using index
+1 PRIMARY t8 const PRIMARY PRIMARY 37 const 1 Using index
+4 SUBQUERY t8 const PRIMARY PRIMARY 37 1 Using index
+2 SUBQUERY t8 const PRIMARY PRIMARY 37 const 1
+3 SUBQUERY t8 const PRIMARY PRIMARY 37 1 Using index
Warnings:
-Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` AS `email`
from `test`.`t8` where (`test`.`t8`.`pseudo` = (select `test`.`t8`.`pseudo` AS `pseudo`
from `test`.`t8` where (`test`.`t8`.`pseudo` = _latin1'joce')))) AS `(SELECT email FROM
t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce'))` from `test`.`t8` where
(`test`.`t8`.`pseudo` = (select `test`.`t8`.`pseudo` AS `pseudo` from `test`.`t8` where
(`test`.`t8`.`pseudo` = _latin1'joce')))
+Note 1003 select `test`.`t8`.`pseudo` AS `pseudo`,(select `test`.`t8`.`email` AS `email`
from `test`.`t8` where 1) AS `(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8
WHERE pseudo='joce'))` from `test`.`t8` where 1
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
t8 WHERE pseudo='joce');
ERROR 21000: Operand should contain 1 column(s)
@@ -3456,6 +3456,32 @@ id select_type table type possible_keys
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
4 UNION t12 system NULL NULL NULL NULL 0 const row not found
NULL UNION RESULT <union2,4> ALL NULL NULL NULL NULL NULL
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
+insert into t1 (a) values (FLOOR(rand() * 100));
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+SELECT a,
+(SELECT REPEAT(' ',250) FROM t1 i1
+WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a
+FROM t1 ORDER BY a LIMIT 5;
+a a
+0 NULL
+0 NULL
+0 NULL
+0 NULL
+0 NULL
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT);
--- 1.180/mysql-test/r/view.result 2006-10-24 14:42:21 -06:00
+++ 1.181/mysql-test/r/view.result 2006-10-24 14:42:21 -06:00
@@ -1980,7 +1980,7 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`r
drop view v1;
drop table t1;
set sql_mode='strict_all_tables';
-CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL) ENGINE = INNODB;
+CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL);
CREATE VIEW v1 (vcol1) AS SELECT col1 FROM t1;
CREATE VIEW v2 (vcol1) AS SELECT col1 FROM t1 WHERE col2 > 2;
INSERT INTO t1 (col1) VALUES(12);
@@ -2032,7 +2032,7 @@ f3 f1
1 3
drop view v1;
drop table t1;
-CREATE TABLE t1 (f1 char) ENGINE = innodb;
+CREATE TABLE t1 (f1 char);
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES('B');
--- 1.131/mysql-test/t/subselect.test 2006-10-24 14:42:21 -06:00
+++ 1.132/mysql-test/t/subselect.test 2006-10-24 14:42:21 -06:00
@@ -2371,6 +2371,32 @@ explain select * from t1 where not exist
DROP TABLE t1;
#
+# Bug#21798: memory leak during query execution with subquery in column
+# list using a function
+#
+CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
+insert into t1 (a) values (FLOOR(rand() * 100));
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+insert into t1 (a) select FLOOR(rand() * 100) from t1;
+
+SELECT a,
+ (SELECT REPEAT(' ',250) FROM t1 i1
+ WHERE i1.b=t1.a ORDER BY RAND() LIMIT 1) AS a
+FROM t1 ORDER BY a LIMIT 5;
+DROP TABLE t1;
+
+#
# Bug #21540: Subqueries with no from and aggregate functions return
# wrong results
CREATE TABLE t1 (a INT, b INT);
--- 1.167/mysql-test/t/view.test 2006-10-24 14:42:21 -06:00
+++ 1.168/mysql-test/t/view.test 2006-10-24 14:42:21 -06:00
@@ -1801,7 +1801,7 @@ drop table t1;
# underlying tables (BUG#6443)
#
set sql_mode='strict_all_tables';
-CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL) ENGINE = INNODB;
+CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL);
CREATE VIEW v1 (vcol1) AS SELECT col1 FROM t1;
CREATE VIEW v2 (vcol1) AS SELECT col1 FROM t1 WHERE col2 > 2;
-- error 1364
@@ -1857,7 +1857,7 @@ drop table t1;
#
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
#
-CREATE TABLE t1 (f1 char) ENGINE = innodb;
+CREATE TABLE t1 (f1 char);
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
--- 1.13/mysql-test/r/rename.result 2006-10-24 14:42:21 -06:00
+++ 1.14/mysql-test/r/rename.result 2006-10-24 14:42:21 -06:00
@@ -54,3 +54,13 @@ Tables_in_test
t2
t4
drop table t2, t4;
+create table t1(f1 int);
+create view v1 as select * from t1;
+alter table v1 rename to v2;
+alter table v1 rename to v2;
+ERROR 42S02: Table 'test.v1' doesn't exist
+rename table v2 to v1;
+rename table v2 to v1;
+ERROR 42S01: Table 'v1' already exists
+drop view v1;
+drop table t1;
| Thread |
|---|
| • bk commit into 5.0 tree (tsmith:1.2330) | tim | 24 Oct |