Commit a4f853e2 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

Merge

parents b4974dac f1e8696a
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614
a MATCH (message) AGAINST ('steve')
4 0.90587321329654
7 0.89568988462614
a MATCH (message) AGAINST ('steve')
7 0.89568988462614
4 0.90587321329654
a MATCH (message) AGAINST ('steve')
7 0.89568988462614
id elt(two.val,'one','two')
1 one
2 one
4 two
1+1 1-1 1+1*2 8/5 8%5 MOD(8,5) MOD(8,5)|0 -(1+1)*-2 SIGN(-5)
2 0 3 1.60 3 3 3 4 -1
id elt(two.val,'one','two')
1 one
2 one
4 two
FLOOR(5.5) FLOOR(-5.5) CEILING(5.5) CEILING(-5.5) ROUND(5.5) ROUND(-5.5)
5 -6 6 -5 6 -6
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
0 256 65536 2147483647 -2147483648 2147483648 0
0 256 65536 2147483647 -2147483648 2147483648 4294967296
id elt(two.val,'one','two')
1 one
2 one
4 two
id elt(two.val,'one','two')
1 one
2 one
4 two
use test;
DROP TABLE IF EXISTS test;
CREATE TABLE test (
a INT AUTO_INCREMENT PRIMARY KEY,
message CHAR(20),
FULLTEXT(message)
) comment = 'testcase by sroussey@network54.com';
INSERT INTO test (message) VALUES ("Testing"),("table"),("testbug"),
("steve"),("is"),("cool"),("steve is cool");
@r/ft0000001.a.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve');
@r/ft0000001.b.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE MATCH (message) AGAINST ('steve') ORDER BY a;
@r/ft0000001.c.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC;
@r/ft0000001.d.result SELECT a, MATCH (message) AGAINST ('steve') FROM test WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1;
......@@ -7,15 +7,8 @@
#
# Description
# -----------
# test for a bug with elt() and order by
drop table if exists elt_ck1,elt_ck2;
create table elt_ck1 (id int(10) not null unique);
create table elt_ck2 (id int(10) not null primary key,
val int(10) not null);
insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/sel000004.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two
where two.id=one.id order by one.id;
# Simple arithmetic.
# Testing MOD(), SIGN(), and arithmetic grouping.
#
@r/sel000004.result SELECT 1+1,1-1,1+1*2,8/5,8%5,MOD(8,5),MOD(8,5)|0,-(1+1)*-2,SIGN(-5);
# sel000004
# sel000005
#
# Versions
# --------
......@@ -7,15 +7,8 @@
#
# Description
# -----------
# test for a bug with elt()
drop table if exists elt_ck1,elt_ck2;
create table elt_ck1 (id int(10) not null unique);
create table elt_ck2 (id int(10) not null primary key,
val int(10) not null);
insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/sel000005.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two
where two.id=one.id ;
# Numeric functions.
# Testing FLOOR(), CEILING(), ROUND().
#
@r/sel000005.result SELECT FLOOR(5.5),FLOOR(-5.5),CEILING(5.5),CEILING(-5.5),ROUND(5.5),ROUND(-5.5);
# sel000006
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric functions.
# Testing ROUND(); hundreths precision.
#
@r/sel000006.result SELECT ROUND(5.64,1),ROUND(5.64,2),ROUND(5.64,-1),ROUND(5.64,-2);
# sel000007
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric functions.
# Testing TRUNCATE().
#
@r/sel000007.result SELECT TRUNCATE(52.64,1),TRUNCATE(52.64,2),TRUNCATE(52.64,-1),TRUNCATE(52.64,-2);
# sel000008
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric functions.
# Testing ABS(), LOG(), LOG10(), EXP(), SQRT(), POW(), RAND(), POWER().
#
@r/sel000008.result SELECT ABS(-10),LOG(EXP(10)),EXP(LOG(SQRT(10))*2),POW(10,LOG10(10)),RAND(999999),RAND(),POWER(2,4);
# sel000009
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric functions.
# Testing PI(), SIN(), COS(), TAN(), COT(), ASIN(), ACOS(), ATAN().
#
@r/sel000009.result SELECT PI(),SIN(PI()/2),COS(PI()/2),TAN(PI()),COT(1),ASIN(1),ACOS(0),ATAN(1);
# sel000010
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric bitwise comparisons.
# Testing |, &, BIT_COUNT().
#
@r/sel000010.result SELECT 1 | (1+1),5 & 3,BIT_COUNT(7);
# sel000011
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric bitmoving comparisons.
# Testing <<, >>.
#
@r/sel000011.result SELECT 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60;
# sel000012
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric floating point.
#
@r/sel000012.result SELECT 10,10.0,10.,.1e+2,100.0e-1;
# sel000013
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numeric floating point.
#
@r/sel000013.result SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
# sel000014
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing pos/neg and zero padding.
#
@r/sel000014.result SELECT 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
# sel000015
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing big numbers.
#
@r/sel000015.result SELECT 922337203685477580,92233720368547758000;
# sel000016
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing big negative numbers.
#
@r/sel000016.result SELECT -922337203685477580,-92233720368547758000;
# sel000017
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing big pos/neg numbers.
#
@r/sel000017.result SELECT 9223372036854775807,-009223372036854775808;
# sel000018
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing big pos/neg numbers.
#
@r/sel000018.result SELECT +9999999999999999999,-9999999999999999999;
# sel000019
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Numerics.
# Testing DEGREES(), RADIANS().
#
@r/sel000019.result SELECT DEGREES(PI()),RADIANS(360);
# sel000020
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; STRCMP(), =, >, >=, <=, !=.
#
@r/sel000020.result SELECT 0=0,1>0,1>=1,1<0,1<=0,1!=0,STRCMP("abc","abcd"),STRCMP("b","a"),STRCMP("a","a");
# sel000021
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; =, >, >=, <=, <>.
#
@r/sel000021.result SELECT "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b";
# sel000022
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; =, >, <=.
#
@r/sel000022.result SELECT "a "="A", "A "="a", "a " <= "A b";
# sel000023
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; LIKE, NOT LIKE, '%'.
#
@r/sel000023.result SELECT "abc" LIKE "a%", "abc" NOT LIKE "%d%", "a%" LIKE "a\%","abc%" LIKE "a%\%","abcd" LIKE "a%b_%d", "a" LIKE "%%a","abcde" LIKE "a%_e","abc" LIKE "abc%";
# sel000024
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; LIKE, '%'.
#
@r/sel000024.result SELECT "a" LIKE "%%b","a" LIKE "%%ab","ab" LIKE "a\%", "ab" LIKE "_", "ab" LIKE "ab_", "abc" LIKE "%_d", "abc" LIKE "abc%d";
# sel000025
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; LIKE, ESCAPE, '%'.
#
@r/sel000025.result SELECT '?' LIKE '|%', '?' LIKE '|%' ESCAPE '|', '%' LIKE '|%', '%' LIKE '|%' ESCAPE '|', '%' LIKE '%';
# sel000026
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; LIKE, '%'.
#
@r/sel000026.result SELECT 'abc' LIKE '%c','abcabc' LIKE '%c', "ab" LIKE "", "ab" LIKE "a", "ab" LIKE "ab";
# sel000027
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; REGEXP.
#
@r/sel000027.result SELECT "Det hr r svenska" REGEXP "h[[:alpha:]]+r", "aba" REGEXP "^(a|b)*$";
# sel000028
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; REGEXP, CONCAT().
#
@r/sel000028.result SELECT "aba" REGEXP CONCAT("^","a");
# sel000029
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Strings.
# Testing string comparisons; NOT, AND, OR, !, &&, ||.
#
@r/sel000029.result SELECT !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 OR 1=1 AND 1=0;
# sel000030
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# Control flow.
# Testing control flow; IF()
#
@r/sel000030.result SELECT IF(0,"ERROR","this"),IF(1,"is","ERROR"),IF(NULL,"ERROR","a"),IF(1,2,3)|0,IF(1,2.0,3.0)+0;
# sel000031
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# test for a bug with elt() and order by
drop table if exists elt_ck1,elt_ck2;
create table elt_ck1 (id int(10) not null unique);
create table elt_ck2 (id int(10) not null primary key,
val int(10) not null);
insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/sel000031.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two where two.id=one.id order by one.id;
# sel000032
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# test for a bug with elt()
drop table if exists elt_ck1,elt_ck2;
create table elt_ck1 (id int(10) not null unique);
create table elt_ck2 (id int(10) not null primary key,
val int(10) not null);
insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/sel000032.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two where two.id=one.id;
# sel000033
#
# Versions
# --------
# 3.22
# 3.23
#
# Description
# -----------
# test for a bug with in() and unique key
drop table if exists t;
create table t (id int(10) primary key);
insert into t values (1),(2),(3),(4),(5),(6),(7),(8),(9);
@r/sel000033.result select id from t where id in (2,5,9) ;
@r/sel000033.result select id from t where id=2 or id=5 or id=9 ;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment