summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/r/rocksdb_parts.result
blob: 2fde11c2a0862e863283484bbccbd0a182aa2b2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
drop table if exists t1,t2;
# Tests for MyRocks + partitioning
#
# MyRocks Issue #70: Server crashes in Rdb_key_def::get_primary_key_tuple
#
CREATE TABLE t1 (pk INT PRIMARY KEY, f1 INT, f2 INT, KEY(f2)) ENGINE=RocksDB 
PARTITION BY HASH(pk) PARTITIONS 2;
INSERT INTO t1 VALUES (1, 6, NULL), (2, NULL, 1);
CREATE TABLE t2 (pk INT PRIMARY KEY, f1 INT) ENGINE=RocksDB;
INSERT INTO t2 VALUES (1, 1), (2, 1);
SELECT f1 FROM t1 WHERE f2 = ( SELECT f1 FROM t2 WHERE pk = 2 );
f1
NULL
drop table t1,t2;
#
# Issue#105: key_info[secondary_key].actual_key_parts does not include primary key on partitioned tables
#
CREATE TABLE t1 (
id INT PRIMARY KEY,
a set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')  CHARACTER SET utf8,
b set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')  CHARACTER SET utf8 default null,
c set ('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z')  CHARACTER SET utf8 not null,
INDEX (a),
INDEX (b),
INDEX (c)
) ENGINE=RocksDB PARTITION BY key (id) partitions 2;
INSERT INTO t1 (id, b) VALUES (28, 3);
Warnings:
Warning	1364	Field 'c' doesn't have a default value
UPDATE t1 SET id=8 WHERE c < 8 LIMIT 1;
check table t1;
Table	Op	Msg_type	Msg_text
test.t1	check	status	OK
drop table t1;
# 
#  Issue #105, another testcase
# 
create table t1 (
pk int primary key,
col1 int,
col2 int,
key (col1) comment 'rev:cf_issue105'
) engine=rocksdb partition by hash(pk) partitions 2;
insert into t1 values (1,10,10);
insert into t1 values (2,10,10);
insert into t1 values (11,20,20);
insert into t1 values (12,20,20);
set @tmp_rfirr= @@rocksdb_force_index_records_in_range;
set rocksdb_force_index_records_in_range= 12;
explain select * from t1 force index(col1) where col1=10;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	col1	col1	5	const	#	
select * from t1 force index(col1) where col1=10;
pk	col1	col2
1	10	10
2	10	10
select * from t1 use index () where col1=10;
pk	col1	col2
2	10	10
1	10	10
set rocksdb_force_index_records_in_range= @tmp_rfirr;
drop table t1;
#
# Issue #108: Index-only scans do not work for partitioned tables and extended keys
#
create table t1 (
pk int primary key,
col1 int,
col2 int,
key (col1)
) engine=rocksdb partition by hash(pk) partitions 2;
insert into t1 values (1,10,10);
insert into t1 values (2,10,10);
insert into t1 values (11,20,20);
insert into t1 values (12,20,20);
# The following must use "Using index"
explain select pk from t1 force index(col1) where col1=10;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	col1	col1	5	const	2000	Using index
drop table t1;
#
# Issue #214: subqueries cause crash
#
create TABLE t1(a int,b int,c int,primary key(a,b))
partition by list (b*a) (partition x1 values in (1) tablespace ts1,
partition x2 values in (3,11,5,7) tablespace ts2,
partition x3 values in (16,8,5+19,70-43) tablespace ts3);
create table t2(b binary(2));
set session optimizer_switch='materialization=off';
insert into t1(a,b) values(1,7);
select a from t1 where a in (select a from t1 where a in (select b from t2));
a
drop table t1, t2;
#
# Issue #260: altering name to invalid value leaves table unaccessible
#
CREATE TABLE t1 (c1 INT NOT NULL, c2 CHAR(5)) PARTITION BY HASH(c1) PARTITIONS 4;
INSERT INTO t1 VALUES(1,'a');
RENAME TABLE t1 TO db3.t3;
ERROR HY000: Error on rename of './test/t1' to './db3/t3' (errno: -1 "Internal error < 0 (Not system error)")
SELECT * FROM t1;
c1	c2
1	a
SHOW TABLES;
Tables_in_test
t1
RENAME TABLE t1 TO test.t3;
SELECT * FROM t3;
c1	c2
1	a
SHOW TABLES;
Tables_in_test
t3
CREATE DATABASE db3;
USE test;
RENAME TABLE t3 to db3.t2;
USE db3;
SELECT * FROM t2;
c1	c2
1	a
SHOW TABLES;
Tables_in_db3
t2
DROP TABLE t2;
use test;
DROP DATABASE db3;
#
# MDEV-13153 Assertion `global_status_var.global_memory_used == 0 ' 
#            failed upon server restart with partitioned RocksDB table
#
CREATE TABLE t1 (a INT) ENGINE=RocksDB PARTITION BY HASH(a) PARTITIONS 2;
INSERT INTO t1 (a) VALUES (1),(2);
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
SELECT 1;
1
1
DROP TABLE t1;
#
# MDEV-15245: Assertion `false' failed in myrocks::ha_rocksdb::position
#
CREATE TABLE t1 (a INT) ENGINE=RocksDB;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT) ENGINE=RocksDB 
PARTITION BY RANGE(b) 
(PARTITION p0 VALUES LESS THAN (1), 
PARTITION p1 VALUES LESS THAN MAXVALUE);
INSERT INTO t2 VALUES (NULL),(0);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.* FROM t1, t2;
UPDATE v1 SET b = 5;
drop view v1;
drop table t1,t2;