Commit d17aebaa authored by unknown's avatar unknown
Browse files

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

into mysql.com:/home/my/mysql-5.0


sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
parents 73ddce6d ce169a54
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -351,11 +351,21 @@ then

  if echo $CXX | grep gcc > /dev/null 2>&1
  then
    if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
    then
    GCC_VERSION=`gcc -v 2>&1 | grep version | sed -e 's/[[^0-9. ]]//g; s/^ *//g; s/ .*//g'`
    echo "Using gcc version '$GCC_VERSION'"
    case "$GCC_VERSION" in
      3.4.*|3.5.*)
        # Statically link the language support function's found in libsupc++.a
        LIBS="$LIBS -lsupc++"
    fi
	echo "Using -libsupc++ for static linking with gcc"
      ;;
      *)
        # Using -lsupc++ doesn't work in gcc 3.3 on SuSE 9.2
        # (causes link failures when linking things staticly)
        CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
	echo "Using MYSYS_NEW for static linking with gcc"
      ;;
    esac
  fi
fi

+2 −0
Original line number Diff line number Diff line
@@ -87,6 +87,8 @@ drop table t1;
SELECT '0x8000000000000001'+0;
'0x8000000000000001'+0
0
Warnings:
Warning	1292	Truncated incorrect DOUBLE value: '0x8000000000000001'
create table t1 (
value64  bigint unsigned  not null,
value32  integer          not null,
+68 −0
Original line number Diff line number Diff line
@@ -7,6 +7,9 @@ CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER)
select CONVERT('-1',UNSIGNED);
CONVERT('-1',UNSIGNED)
18446744073709551615
select CAST('10 ' as unsigned integer);
CAST('10 ' as unsigned integer)
10
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
cast(-5 as unsigned) | 1	cast(-5 as unsigned) & -1
18446744073709551611	18446744073709551611
@@ -42,6 +45,15 @@ cast("1:2:3" as TIME)
select CONVERT("2004-01-22 21:45:33",DATE);
CONVERT("2004-01-22 21:45:33",DATE)
2004-01-22
select 10+'10';
10+'10'
20
select 10.0+'10';
10.0+'10'
20
select 10E+0+'10';
10E+0+'10'
20
select CONVERT(DATE "2004-01-22 21:45:33" USING latin1);
CONVERT(DATE "2004-01-22 21:45:33" USING latin1)
2004-01-22 21:45:33
@@ -51,12 +63,43 @@ CONVERT(DATE "2004-01-22 21:45:33",CHAR)
select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
CONVERT(DATE "2004-01-22 21:45:33",CHAR(4))
2004
Warnings:
Warning	1292	Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
CONVERT(DATE "2004-01-22 21:45:33",BINARY(4))
2004
Warnings:
Warning	1292	Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
2004
Warnings:
Warning	1292	Truncated incorrect CHAR(4) value: '2004-01-22 21:45:33'
select cast('-10a' as signed integer);
cast('-10a' as signed integer)
-10
Warnings:
Warning	1292	Truncated incorrect INTEGER value: '-10a'
select cast('a10' as unsigned integer);
cast('a10' as unsigned integer)
0
Warnings:
Warning	1292	Truncated incorrect INTEGER value: 'a10'
select 10+'a';
10+'a'
10
Warnings:
Warning	1292	Truncated incorrect DOUBLE value: 'a'
select 10.0+cast('a' as decimal);
10.0+cast('a' as decimal)
10.00
Warnings:
Error	1366	Incorrect decimal value: '' for column '' at row -1
select 10E+0+'a';
10E+0+'a'
10
Warnings:
Warning	1292	Truncated incorrect DOUBLE value: 'a'
set names binary;
select cast(_latin1'test' as char character set latin2);
cast(_latin1'test' as char character set latin2)
@@ -79,12 +122,23 @@ cast(_latin1'a ' AS char(2)) as c4,
cast(_latin1'a'   AS char(2)) as c5;
c1	c2	c3	c4	c5
ab	a 	ab	a 	a
Warnings:
Warning	1292	Truncated incorrect CHAR(2) value: 'abc'
Warning	1292	Truncated incorrect CHAR(2) value: 'a  '
select cast(1000 as CHAR(3));
cast(1000 as CHAR(3))
100
Warnings:
Warning	1292	Truncated incorrect CHAR(3) value: '1000'
create table t1 select
cast(_latin1'ab'  AS char)    as c1,
cast(_latin1'a '  AS char)    as c2,
cast(_latin1'abc' AS char(2)) as c3,
cast(_latin1'a  ' AS char(2)) as c4,
cast(_latin1'a'   AS char(2)) as c5;
Warnings:
Warning	1292	Truncated incorrect CHAR(2) value: 'abc'
Warning	1292	Truncated incorrect CHAR(2) value: 'a  '
select * from t1;
c1	c2	c3	c4	c5
ab	a 	ab	a 	a
@@ -106,12 +160,18 @@ cast(_koi8r'
cast(_koi8r''   AS nchar(2)) as c5;
c1	c2	c3	c4	c5
фг	ф 	фг	ф 	ф
Warnings:
Warning	1292	Truncated incorrect CHAR(4) value: 'фгх'
Warning	1292	Truncated incorrect CHAR(3) value: 'ф  '
create table t1 select
cast(_koi8r''  AS nchar)    as c1,
cast(_koi8r' '  AS nchar)    as c2,
cast(_koi8r'' AS nchar(2)) as c3,
cast(_koi8r'  ' AS nchar(2)) as c4,
cast(_koi8r''   AS nchar(2)) as c5;
Warnings:
Warning	1292	Truncated incorrect CHAR(4) value: 'фгх'
Warning	1292	Truncated incorrect CHAR(3) value: 'ф  '
select * from t1;
c1	c2	c3	c4	c5
фг	ф 	фг	ф 	ф
@@ -167,6 +227,10 @@ a CAST(a AS CHAR(3))
aac	aac
aab	aab
aaa	aaa
Warnings:
Warning	1292	Truncated incorrect CHAR(2) value: 'aaa'
Warning	1292	Truncated incorrect CHAR(2) value: 'aab'
Warning	1292	Truncated incorrect CHAR(2) value: 'aac'
SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ;
a	CAST(a AS UNSIGNED)
aaa	3
@@ -177,6 +241,10 @@ a CAST(a AS CHAR(2))
aaa	aa
aab	aa
aac	aa
Warnings:
Warning	1292	Truncated incorrect CHAR(2) value: 'aaa'
Warning	1292	Truncated incorrect CHAR(2) value: 'aab'
Warning	1292	Truncated incorrect CHAR(2) value: 'aac'
DROP TABLE t1;
select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour);
date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour)
+15 −3
Original line number Diff line number Diff line
@@ -44,12 +44,24 @@ create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
create table test (a datetime default now());
create table t1 (a datetime default now());
ERROR 42000: Invalid default value for 'a'
create table test (a datetime on update now());
create table t1 (a datetime on update now());
ERROR HY000: Invalid ON UPDATE clause for 'a' column
create table test (a int default 100 auto_increment);
create table t1 (a int default 100 auto_increment);
ERROR 42000: Invalid default value for 'a'
create table t1 (a tinyint default 1000);
ERROR 42000: Invalid default value for 'a'
create table t1 (a varchar(5) default 'abcdef');
ERROR 42000: Invalid default value for 'a'
create table t1 (a varchar(5) default 'abcde');
insert into t1 values();
select * from t1;
a
abcde
alter table t1 alter column a set default 'abcdef';
ERROR 42000: Invalid default value for 'a'
drop table t1;
create table 1ea10 (1a20 int,1e int);
insert into 1ea10 values(1,1);
select 1ea10.1a20,1e+ 1e+10 from 1ea10;
+11 −6
Original line number Diff line number Diff line
@@ -44,21 +44,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	7	Using where; Using filesort
Warnings:
Note	1003	select if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary)) AS `s` from `test`.`t1` where (`test`.`t1`.`st` like _latin1'%a%') order by if((`test`.`t1`.`u` = 1),`test`.`t1`.`st`,cast(`test`.`t1`.`st` as char charset binary))
select nullif(u=0, 'test') from t1;
nullif(u=0, 'test')
select nullif(u, 1) from t1;
nullif(u, 1)
NULL
NULL
NULL
NULL
NULL
1
1
explain extended select nullif(u=0, 'test') from t1;
0
0
explain extended select nullif(u, 1) from t1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	7	
Warnings:
Note	1003	select nullif((`test`.`t1`.`u` = 0),_latin1'test') AS `nullif(u=0, 'test')` from `test`.`t1`
Note	1003	select nullif(`test`.`t1`.`u`,1) AS `nullif(u, 1)` from `test`.`t1`
drop table t1;
select nullif(1,'test');
nullif(1,'test')
1
Warnings:
Warning	1292	Truncated incorrect DOUBLE value: 'test'
select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
NULLIF(NULL,NULL)	NULLIF(NULL,1)	NULLIF(NULL,1.0)	NULLIF(NULL,"test")
NULL	NULL	NULL	NULL
Loading