Commit 6a4fbf09 authored by unknown's avatar unknown
Browse files

Merge mysql.com:/d2/hf/common/my50-common

into  mysql.com:/d2/hf/opt/my50-opt


myisam/mi_check.c:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
parents 42a7506d 4c737cf1
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1813,6 +1813,12 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
  MI_STATE_INFO old_state;
  DBUG_ENTER("mi_sort_index");

  /* cannot sort index files with R-tree indexes */
  for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ;
       key++,keyinfo++)
    if (keyinfo->key_alg == HA_KEY_ALG_RTREE)
      return 0;

  if (!(param->testflag & T_SILENT))
    printf("- Sorting index for MyISAM-table '%s'\n",name);

@@ -1905,6 +1911,8 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
  char llbuff[22];
  DBUG_ENTER("sort_one_index");

  /* cannot walk over R-tree indices */
  DBUG_ASSERT(keyinfo->key_alg != HA_KEY_ALG_RTREE);
  new_page_pos=param->new_file_pos;
  param->new_file_pos+=keyinfo->block_length;

+11 −0
Original line number Diff line number Diff line
@@ -881,3 +881,14 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
INSERT INTO t1(foo) VALUES ('');
ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
DROP TABLE t1;
CREATE TABLE t1 (a INT AUTO_INCREMENT, b POINT NOT NULL, KEY (a), SPATIAL KEY (b));
INSERT INTO t1 (b) VALUES (GeomFromText('POINT(1 2)'));
INSERT INTO t1 (b) SELECT b FROM t1;
INSERT INTO t1 (b) SELECT b FROM t1;
INSERT INTO t1 (b) SELECT b FROM t1;
INSERT INTO t1 (b) SELECT b FROM t1;
INSERT INTO t1 (b) SELECT b FROM t1;
OPTIMIZE TABLE t1;
Table	Op	Msg_type	Msg_text
test.t1	optimize	status	OK
DROP TABLE t1;
+15 −0
Original line number Diff line number Diff line
@@ -1514,4 +1514,19 @@ Variable_name Value
Slow_queries	1
deallocate prepare no_index;
deallocate prepare sq;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1), (2);
CREATE TABLE t2 (b int);
INSERT INTO t2 VALUES (NULL);
SELECT a FROM t1 WHERE (SELECT b FROM t2) IS NULL;
a
1
2
PREPARE stmt FROM 'SELECT a FROM t1 WHERE (SELECT b FROM t2) IS NULL';
EXECUTE stmt;
a
1
2
DEALLOCATE PREPARE stmt;
DROP TABLE t1,t2;
End of 5.0 tests.
+13 −0
Original line number Diff line number Diff line
@@ -3033,6 +3033,19 @@ t3 CREATE TABLE `t3` (
  `a` datetime default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2,t3;
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES (1), (2);
SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) > 0;
a
SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
a
1
2
EXPLAIN SELECT a FROM t1 WHERE (SELECT 1 FROM DUAL WHERE 1=0) IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	2	
2	SUBQUERY	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE
DROP TABLE t1;
create table t1 (df decimal(5,1));
insert into t1 values(1.1);
insert into t1 values(2.2);
+11 −0
Original line number Diff line number Diff line
@@ -194,6 +194,17 @@ DROP FUNCTION sequence;
DROP FUNCTION lookup;
DROP FUNCTION reverse_lookup;
DROP FUNCTION avgcost;
select * from mysql.func;
name	ret	dl	type
CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
select IS_const(3);
IS_const(3)
const
drop function IS_const;
select * from mysql.func;
name	ret	dl	type
select is_const(3);
ERROR 42000: FUNCTION test.is_const does not exist
CREATE FUNCTION is_const RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
select
is_const(3) as const,
Loading