Commit 73baa90a authored by unknown's avatar unknown
Browse files

Merge bk-internal:/home/bk/mysql-5.1

into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1-opt


mysql-test/r/myisam.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents 94f337bb 95124370
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -229,12 +229,17 @@ enum ha_base_keytype {
#define HA_USES_PARSER           16384  /* Fulltext index uses [pre]parser */
#define HA_USES_BLOCK_SIZE	 ((uint) 32768)
#define HA_SORT_ALLOWS_SAME      512    /* Intern bit when sorting records */
#if MYSQL_VERSION_ID < 0x50200
/*
  Key has a part that can have end space.  If this is an unique key
  we have to handle it differently from other unique keys as we can find
  many matching rows for one key (because end space are not compared)
*/
#define HA_END_SPACE_KEY	4096
#define HA_END_SPACE_KEY      0 /* was: 4096 */
#else
#error HA_END_SPACE_KEY is obsolete, please remove it
#endif


	/* These flags can be added to key-seg-flag */

+18 −0
Original line number Diff line number Diff line
@@ -321,6 +321,24 @@ SELECT COUNT(*) FROM t2 LEFT JOIN t1 ON t2.fkey = t1.id

DROP TABLE t1,t2;

#
# 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;

#
# Test of behaviour with CREATE ... SELECT
#
+0 −5
Original line number Diff line number Diff line
@@ -74,11 +74,6 @@ grp group_concat(c order by 1)
1	a
2	b,c
3	C,D,d,d,D,E
select grp,group_concat(c order by "c") from t1 group by grp;
grp	group_concat(c order by "c")
1	a
2	b,c
3	C,D,d,d,D,E
select grp,group_concat(distinct c order by c) from t1 group by grp;
grp	group_concat(distinct c order by c)
1	a
+2 −2
Original line number Diff line number Diff line
@@ -1143,9 +1143,9 @@ EXPLAIN EXTENDED
SELECT * FROM t1 INNER JOIN t2 ON code=id 
WHERE id='a12' AND (LENGTH(code)=5 OR code < 'a00');
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	t2	const	PRIMARY	PRIMARY	12	const	1	100.00	Using index
1	SIMPLE	t1	ref	code	code	13	const	3	100.00	Using where; Using index
1	SIMPLE	t2	ref	PRIMARY	PRIMARY	12	const	1	100.00	Using where; Using index
Warnings:
Note	1003	select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (`test`.`t2`.`id` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5))
Note	1003	select `test`.`t1`.`code` AS `code`,`test`.`t2`.`id` AS `id` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`code` = _latin1'a12') and (length(`test`.`t1`.`code`) = 5))
DROP TABLE t1,t2;
End of 5.0 tests
+11 −0
Original line number Diff line number Diff line
@@ -862,3 +862,14 @@ CHECK TABLE t1 EXTENDED;
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
DROP TABLE t1;
CREATE TABLE t1 (foo GEOMETRY NOT NULL, SPATIAL INDEX(foo) );
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(1,0)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,1)));
INSERT INTO t1 (foo) VALUES (PointFromWKB(POINT(0,0)));
SELECT 1 FROM t1 WHERE foo != PointFromWKB(POINT(0,0));
1
1
1
1
DROP TABLE t1;
Loading