Commit e4cdb580 authored by unknown's avatar unknown
Browse files

Merge olga.mysql.com:/home/igor/mysql-5.0-opt

into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26560


sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
parents 6da758c2 cbd324d2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -463,5 +463,11 @@ CREATE TABLE t3 (a BIGINT UNSIGNED);
INSERT INTO t3 VALUES (9223372036854775551);
SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);
HEX(a)
DROP TABLE t1,t2,t3;
CREATE TABLE t4 (a DATE);
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');
a
Warnings:
Warning	1292	Incorrect date value: '19772-07-29' for column 'a' at row 1
DROP TABLE t1,t2,t3,t4;
End of 5.0 tests
+8 −0
Original line number Diff line number Diff line
@@ -926,3 +926,11 @@ NULL
2
3
DROP TABLE t1,t2,t3,t4;
create table t1 (a int, b int, c int);
insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
a	ratio
1	0.5000
19	1.3333
9	2.6667
drop table t1;
+4 −0
Original line number Diff line number Diff line
@@ -377,6 +377,10 @@ create table t1(f1 int, `*f2` int);
insert into t1 values (1,1);
update t1 set `*f2`=1;
drop table t1;
create table t1(f1 int);
update t1 set f2=1 order by f2;
ERROR 42S22: Unknown column 'f2' in 'order clause'
drop table t1;
CREATE TABLE t1 (
request_id int unsigned NOT NULL auto_increment,
user_id varchar(12) default NULL,
+5 −1
Original line number Diff line number Diff line
@@ -354,6 +354,10 @@ INSERT INTO t3 VALUES (9223372036854775551);

SELECT HEX(a) FROM t3 WHERE a IN (9223372036854775807, 42);

DROP TABLE t1,t2,t3;
CREATE TABLE t4 (a DATE);
INSERT INTO t4 VALUES ('1972-02-06'), ('1972-07-29');
SELECT * FROM t4 WHERE a IN ('1972-02-06','19772-07-29');

DROP TABLE t1,t2,t3,t4;

--echo End of 5.0 tests
+8 −0
Original line number Diff line number Diff line
@@ -640,3 +640,11 @@ SELECT t2.b FROM t1 LEFT JOIN (t2, t3 LEFT JOIN t4 ON t3.a=t4.a)
ON (t1.a=t2.a AND t1.b=t3.b) order by t2.b;

DROP TABLE t1,t2,t3,t4;

#
# Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
#
create table t1 (a int, b int, c int);
insert into t1 values (1,2,3), (9,8,3), (19,4,3), (1,4,9);
select a,(sum(b)/sum(c)) as ratio from t1 group by a order by sum(b)/sum(c) asc;
drop table t1;
Loading