mirror of
https://github.com/MariaDB/server.git
synced 2025-11-13 21:42:58 +03:00
Merge mysql.com:/home/jonas/src/mysql-4.1
into mysql.com:/home/jonas/src/mysql-4.1-ndb
This commit is contained in:
@@ -750,3 +750,43 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
|
||||
id
|
||||
4
|
||||
DROP TABLE t1;
|
||||
SET NAMES latin1;
|
||||
CREATE TABLE t1 (
|
||||
id int unsigned NOT NULL auto_increment,
|
||||
list_id smallint unsigned NOT NULL,
|
||||
term text NOT NULL,
|
||||
PRIMARY KEY(id),
|
||||
INDEX(list_id, term(19))
|
||||
) TYPE=MyISAM CHARSET=utf8;
|
||||
Warnings:
|
||||
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
||||
INSERT INTO t1 set list_id = 1, term = "test<73>test";
|
||||
INSERT INTO t1 set list_id = 1, term = "testetest";
|
||||
INSERT INTO t1 set list_id = 1, term = "test<73>test";
|
||||
SELECT id, term FROM t1 where (list_id = 1) AND (term = "test<73>test");
|
||||
id term
|
||||
1 test<73>test
|
||||
2 testetest
|
||||
3 test<73>test
|
||||
SELECT id, term FROM t1 where (list_id = 1) AND (term = "testetest");
|
||||
id term
|
||||
1 test<73>test
|
||||
2 testetest
|
||||
3 test<73>test
|
||||
SELECT id, term FROM t1 where (list_id = 1) AND (term = "test<73>test");
|
||||
id term
|
||||
1 test<73>test
|
||||
2 testetest
|
||||
3 test<73>test
|
||||
DROP TABLE t1;
|
||||
set names utf8;
|
||||
create table t1 (
|
||||
a int primary key,
|
||||
b varchar(6),
|
||||
index b3(b(3))
|
||||
) engine=innodb character set=utf8;
|
||||
insert into t1 values(1,'foo'),(2,'foobar');
|
||||
select * from t1 where b like 'foob%';
|
||||
a b
|
||||
2 foobar
|
||||
drop table t1;
|
||||
|
||||
@@ -336,3 +336,42 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
- - - - - - - - NULL Impossible WHERE
|
||||
drop table t1;
|
||||
deallocate prepare stmt;
|
||||
create table t1 (a int);
|
||||
insert into t1 (a) values (1), (2), (3), (4);
|
||||
set @precision=10000000000;
|
||||
select rand(),
|
||||
cast(rand(10)*@precision as unsigned integer),
|
||||
cast(rand(a)*@precision as unsigned integer) from t1;
|
||||
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer)
|
||||
- 6570515219 -
|
||||
- 1282061302 -
|
||||
- 6698761160 -
|
||||
- 9647622201 -
|
||||
prepare stmt from
|
||||
"select rand(),
|
||||
cast(rand(10)*@precision as unsigned integer),
|
||||
cast(rand(a)*@precision as unsigned integer),
|
||||
cast(rand(?)*@precision as unsigned integer) from t1";
|
||||
set @var=1;
|
||||
execute stmt using @var;
|
||||
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
|
||||
- 6570515219 - 4054035371
|
||||
- 1282061302 - 8716141803
|
||||
- 6698761160 - 1418603212
|
||||
- 9647622201 - 944590960
|
||||
set @var=2;
|
||||
execute stmt using @var;
|
||||
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
|
||||
- 6570515219 1559528654 6555866465
|
||||
- 1282061302 6238114970 1223466192
|
||||
- 6698761160 6511989195 6449731873
|
||||
- 9647622201 3845601374 8578261098
|
||||
set @var=3;
|
||||
execute stmt using @var;
|
||||
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(a)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
|
||||
- 6570515219 1559528654 9057697559
|
||||
- 1282061302 6238114970 3730790581
|
||||
- 6698761160 6511989195 1480860534
|
||||
- 9647622201 3845601374 6211931236
|
||||
drop table t1;
|
||||
deallocate prepare stmt;
|
||||
|
||||
Reference in New Issue
Block a user