Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d13c5aa3
Commit
d13c5aa3
authored
May 27, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#19903: Add partition crashes
Added new test cases
parent
ce80d657
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
144 additions
and
0 deletions
+144
-0
mysql-test/r/partition_innodb.result
mysql-test/r/partition_innodb.result
+86
-0
mysql-test/t/partition_innodb.test
mysql-test/t/partition_innodb.test
+58
-0
No files found.
mysql-test/r/partition_innodb.result
0 → 100644
View file @
d13c5aa3
SET @max_row = 20;
DROP TABLE IF EXISTS t0_template;
CREATE TABLE t0_template (
f_int1 INTEGER,
f_int2 INTEGER,
f_char1 CHAR(20),
f_char2 CHAR(20),
f_charbig VARCHAR(1000) ,
PRIMARY KEY(f_int1))
ENGINE = MEMORY;
INSERT INTO t0_template
SET f_int1 = 20, f_int2 = 20, f_char1 = '20', f_char2 = '20',
f_charbig = '===20===';
INSERT INTO t0_template
SET f_int1 = 19, f_int2 = 19, f_char1 = '19', f_char2 = '19',
f_charbig = '===19===';
INSERT INTO t0_template
SET f_int1 = 18, f_int2 = 18, f_char1 = '18', f_char2 = '18',
f_charbig = '===18===';
INSERT INTO t0_template
SET f_int1 = 17, f_int2 = 17, f_char1 = '17', f_char2 = '17',
f_charbig = '===17===';
INSERT INTO t0_template
SET f_int1 = 16, f_int2 = 16, f_char1 = '16', f_char2 = '16',
f_charbig = '===16===';
INSERT INTO t0_template
SET f_int1 = 15, f_int2 = 15, f_char1 = '15', f_char2 = '15',
f_charbig = '===15===';
INSERT INTO t0_template
SET f_int1 = 14, f_int2 = 14, f_char1 = '14', f_char2 = '14',
f_charbig = '===14===';
INSERT INTO t0_template
SET f_int1 = 13, f_int2 = 13, f_char1 = '13', f_char2 = '13',
f_charbig = '===13===';
INSERT INTO t0_template
SET f_int1 = 12, f_int2 = 12, f_char1 = '12', f_char2 = '12',
f_charbig = '===12===';
INSERT INTO t0_template
SET f_int1 = 11, f_int2 = 11, f_char1 = '11', f_char2 = '11',
f_charbig = '===11===';
INSERT INTO t0_template
SET f_int1 = 10, f_int2 = 10, f_char1 = '10', f_char2 = '10',
f_charbig = '===10===';
INSERT INTO t0_template
SET f_int1 = 9, f_int2 = 9, f_char1 = '9', f_char2 = '9',
f_charbig = '===9===';
INSERT INTO t0_template
SET f_int1 = 8, f_int2 = 8, f_char1 = '8', f_char2 = '8',
f_charbig = '===8===';
INSERT INTO t0_template
SET f_int1 = 7, f_int2 = 7, f_char1 = '7', f_char2 = '7',
f_charbig = '===7===';
INSERT INTO t0_template
SET f_int1 = 6, f_int2 = 6, f_char1 = '6', f_char2 = '6',
f_charbig = '===6===';
INSERT INTO t0_template
SET f_int1 = 5, f_int2 = 5, f_char1 = '5', f_char2 = '5',
f_charbig = '===5===';
INSERT INTO t0_template
SET f_int1 = 4, f_int2 = 4, f_char1 = '4', f_char2 = '4',
f_charbig = '===4===';
INSERT INTO t0_template
SET f_int1 = 3, f_int2 = 3, f_char1 = '3', f_char2 = '3',
f_charbig = '===3===';
INSERT INTO t0_template
SET f_int1 = 2, f_int2 = 2, f_char1 = '2', f_char2 = '2',
f_charbig = '===2===';
INSERT INTO t0_template
SET f_int1 = 1, f_int2 = 1, f_char1 = '1', f_char2 = '1',
f_charbig = '===1===';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30)) engine='InnoDB';
INSERT INTO t1 (f_date, f_varchar)
SELECT CONCAT(CAST((f_int1 + 999) AS CHAR),'-02-10'), CAST(f_char1 AS CHAR)
FROM t0_template
WHERE f_int1 + 999 BETWEEN 1000 AND 9999;
SELECT IF(9999 - 1000 + 1 > @max_row, @max_row , 9999 - 1000 + 1)
INTO @exp_row_count;
ALTER TABLE t1 PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER));
# 1.1.5 Add two named partitions + test
ALTER TABLE t1 ADD PARTITION (PARTITION part1, PARTITION part7);
DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t0_aux;
DROP TABLE IF EXISTS t0_definition;
DROP TABLE IF EXISTS t0_template;
mysql-test/t/partition_innodb.test
0 → 100644
View file @
d13c5aa3
--
source
include
/
have_innodb
.
inc
SET
@
max_row
=
20
;
let
$engine
=
'InnoDB'
;
let
$MAX_VALUE
=
(
2147483646
);
let
$max_row
=
`SELECT @max_row`
;
# Column list with definition for all tables to be checked
let
$column_list
=
f_int1
INTEGER
,
f_int2
INTEGER
,
f_char1
CHAR
(
20
),
f_char2
CHAR
(
20
),
f_charbig
VARCHAR
(
1000
);
let
$sub_part_no
=
3
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
t0_template
;
--
enable_warnings
eval
CREATE
TABLE
t0_template
(
$column_list
,
PRIMARY
KEY
(
f_int1
))
ENGINE
=
MEMORY
;
let
$num
=
`SELECT @max_row`
;
while
(
$num
)
{
eval
INSERT
INTO
t0_template
SET
f_int1
=
$num
,
f_int2
=
$num
,
f_char1
=
'$num'
,
f_char2
=
'$num'
,
f_charbig
=
'===$num==='
;
dec
$num
;
}
# 1. Create the table
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
eval
CREATE
TABLE
t1
(
f_date
DATE
,
f_varchar
VARCHAR
(
30
))
engine
=
$engine
;
# 2. Fill the table t1 with records
INSERT
INTO
t1
(
f_date
,
f_varchar
)
SELECT
CONCAT
(
CAST
((
f_int1
+
999
)
AS
CHAR
),
'-02-10'
),
CAST
(
f_char1
AS
CHAR
)
FROM
t0_template
WHERE
f_int1
+
999
BETWEEN
1000
AND
9999
;
# 3. Calculate the number of inserted records.
SELECT
IF
(
9999
-
1000
+
1
>
@
max_row
,
@
max_row
,
9999
-
1000
+
1
)
INTO
@
exp_row_count
;
# DEBUG SELECT @exp_row_count;
# 4. Print the layout, check Readability
ALTER
TABLE
t1
PARTITION
BY
HASH
(
CAST
(
YEAR
(
f_date
)
AS
SIGNED
INTEGER
));
--
echo
# 1.1.5 Add two named partitions + test
ALTER
TABLE
t1
ADD
PARTITION
(
PARTITION
part1
,
PARTITION
part7
);
--
disable_warnings
DROP
VIEW
IF
EXISTS
v1
;
DROP
TABLE
IF
EXISTS
t1
;
DROP
TABLE
IF
EXISTS
t0_aux
;
DROP
TABLE
IF
EXISTS
t0_definition
;
DROP
TABLE
IF
EXISTS
t0_template
;
--
enable_warnings
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment