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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
43da9989
Commit
43da9989
authored
Mar 13, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
parents
51ef8d8d
27b07096
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
195 additions
and
38 deletions
+195
-38
mysql-test/mysql-test-run.pl
mysql-test/mysql-test-run.pl
+116
-38
mysql-test/r/partition_list.result
mysql-test/r/partition_list.result
+11
-0
mysql-test/r/partition_range.result
mysql-test/r/partition_range.result
+26
-0
mysql-test/t/partition_list.test
mysql-test/t/partition_list.test
+14
-0
mysql-test/t/partition_range.test
mysql-test/t/partition_range.test
+27
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-0
No files found.
mysql-test/mysql-test-run.pl
View file @
43da9989
...
@@ -157,6 +157,7 @@ our $path_charsetsdir;
...
@@ -157,6 +157,7 @@ our $path_charsetsdir;
our
$path_client_bindir
;
our
$path_client_bindir
;
our
$path_language
;
our
$path_language
;
our
$path_timefile
;
our
$path_timefile
;
our
$path_snapshot
;
our
$path_manager_log
;
# Used by mysqldadmin
our
$path_manager_log
;
# Used by mysqldadmin
our
$path_slave_load_tmpdir
;
# What is this?!
our
$path_slave_load_tmpdir
;
# What is this?!
our
$path_mysqltest_log
;
our
$path_mysqltest_log
;
...
@@ -320,11 +321,14 @@ our $opt_ndb_extra_test= 0;
...
@@ -320,11 +321,14 @@ our $opt_ndb_extra_test= 0;
our
$exe_ndb_mgm
;
our
$exe_ndb_mgm
;
our
$path_ndb_tools_dir
;
our
$path_ndb_tools_dir
;
our
$path_ndb_backup_dir
;
our
$path_ndb_data_dir
;
our
$path_ndb_slave_data_dir
;
our
$file_ndb_testrun_log
;
our
$file_ndb_testrun_log
;
our
$flag_ndb_status_ok
=
1
;
our
$flag_ndb_status_ok
=
1
;
our
$flag_ndb_slave_status_ok
=
1
;
our
$flag_ndb_slave_status_ok
=
1
;
our
@data_dir_lst
;
######################################################################
######################################################################
#
#
# Function declarations
# Function declarations
...
@@ -405,9 +409,10 @@ sub main () {
...
@@ -405,9 +409,10 @@ sub main () {
{
{
kill_and_cleanup
();
kill_and_cleanup
();
mysql_install_db
();
mysql_install_db
();
if
(
$opt_force
)
# mysql_loadstd(); FIXME copying from "std_data" .frm and
{
# .MGR but there are none?!
save_installed_db
();
}
}
}
}
}
...
@@ -978,6 +983,22 @@ sub command_line_setup () {
...
@@ -978,6 +983,22 @@ sub command_line_setup () {
$path_timefile
=
"
$opt_vardir
/log/mysqltest-time
";
$path_timefile
=
"
$opt_vardir
/log/mysqltest-time
";
$path_mysqltest_log
=
"
$opt_vardir
/log/mysqltest.log
";
$path_mysqltest_log
=
"
$opt_vardir
/log/mysqltest.log
";
$path_snapshot
=
"
$opt_tmpdir
/snapshot_
$opt_master_myport
/
";
# Make a list of all data_dirs
@data_dir_lst
=
(
$master
->
[
0
]
->
{'
path_myddir
'},
$master
->
[
1
]
->
{'
path_myddir
'},
$slave
->
[
0
]
->
{'
path_myddir
'},
$slave
->
[
1
]
->
{'
path_myddir
'},
$slave
->
[
2
]
->
{'
path_myddir
'});
foreach
my
$instance
(
@
{
$instance_manager
->
{'
instances
'}})
{
push
(
@data_dir_lst
,
$instance
->
{'
path_datadir
'});
}
}
}
...
@@ -1127,8 +1148,8 @@ sub executable_setup () {
...
@@ -1127,8 +1148,8 @@ sub executable_setup () {
$exe_master_mysqld
=
$exe_master_mysqld
||
$exe_mysqld
;
$exe_master_mysqld
=
$exe_master_mysqld
||
$exe_mysqld
;
$exe_slave_mysqld
=
$exe_slave_mysqld
||
$exe_mysqld
;
$exe_slave_mysqld
=
$exe_slave_mysqld
||
$exe_mysqld
;
$path_ndb_
backup_dir
=
$path_ndb_
data_dir
=
"
$opt_vardir
/ndbcluster-
$opt_ndbcluster_port
";
"
$opt_vardir
/ndbcluster-
$opt_ndbcluster_port
";
$path_ndb_slave_data_dir
=
"
$opt_vardir
/ndbcluster-
$opt_ndbcluster_port_slave
";
$file_ndb_testrun_log
=
"
$opt_vardir
/log/ndb_testrun.log
";
$file_ndb_testrun_log
=
"
$opt_vardir
/log/ndb_testrun.log
";
}
}
...
@@ -1311,21 +1332,7 @@ sub kill_and_cleanup () {
...
@@ -1311,21 +1332,7 @@ sub kill_and_cleanup () {
mkpath
("
$opt_vardir
/tmp
");
mkpath
("
$opt_vardir
/tmp
");
mkpath
(
$opt_tmpdir
)
if
$opt_tmpdir
ne
"
$opt_vardir
/tmp
";
mkpath
(
$opt_tmpdir
)
if
$opt_tmpdir
ne
"
$opt_vardir
/tmp
";
# FIXME do we really need to create these all, or are they
# Remove old and create new data dirs
# created for us when tables are created?
my
@data_dir_lst
=
(
$master
->
[
0
]
->
{'
path_myddir
'},
$master
->
[
1
]
->
{'
path_myddir
'},
$slave
->
[
0
]
->
{'
path_myddir
'},
$slave
->
[
1
]
->
{'
path_myddir
'},
$slave
->
[
2
]
->
{'
path_myddir
'});
foreach
my
$instance
(
@
{
$instance_manager
->
{'
instances
'}})
{
push
(
@data_dir_lst
,
$instance
->
{'
path_datadir
'});
}
foreach
my
$data_dir
(
@data_dir_lst
)
foreach
my
$data_dir
(
@data_dir_lst
)
{
{
rmtree
("
$data_dir
");
rmtree
("
$data_dir
");
...
@@ -2266,10 +2273,9 @@ sub run_testcase ($) {
...
@@ -2266,10 +2273,9 @@ sub run_testcase ($) {
report_failure_and_restart
(
$tinfo
);
report_failure_and_restart
(
$tinfo
);
}
}
# Save info from this testcase run to mysqltest.log
# Save info from this testcase run to mysqltest.log
my
$testcase_log
=
mtr_fromfile
(
$path_timefile
)
if
-
f
$path_timefile
;
mtr_tofile
(
$path_mysqltest_log
,"
CURRENT TEST
$tname
\n
");
mtr_tofile
(
$path_mysqltest_log
,"
CURRENT TEST
$tname
\n
");
my
$testcase_log
=
mtr_fromfile
(
$path_timefile
);
mtr_tofile
(
$path_mysqltest_log
,
$testcase_log
);
mtr_tofile
(
$path_mysqltest_log
,
$testcase_log
);
}
}
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
...
@@ -2283,6 +2289,80 @@ sub run_testcase ($) {
...
@@ -2283,6 +2289,80 @@ sub run_testcase ($) {
}
}
}
}
sub
copy_dir
($$)
{
my
$from_dir
=
shift
;
my
$to_dir
=
shift
;
mkpath
("
$to_dir
");
opendir
(
DIR
,
"
$from_dir
")
or
mtr_error
("
Can't find
$from_dir
$!
");
for
(
readdir
(
DIR
))
{
next
if
"
$_
"
eq
"
.
"
or
"
$_
"
eq
"
..
";
if
(
-
d
"
$from_dir
/
$_
"
)
{
copy_dir
("
$from_dir
/
$_
",
"
$to_dir
/
$_
");
next
;
}
copy
("
$from_dir
/
$_
",
"
$to_dir
/
$_
");
}
closedir
(
DIR
);
}
#
# Save a snapshot of the installed test db(s)
# I.e take a snapshot of the var/ dir
#
sub
save_installed_db
()
{
mtr_report
("
Saving snapshot of installed databases
");
rmtree
(
$path_snapshot
);
foreach
my
$data_dir
(
@data_dir_lst
)
{
my
$name
=
basename
(
$data_dir
);
copy_dir
("
$data_dir
",
"
$path_snapshot
/
$name
");
}
}
#
# Restore snapshot of the installed test db(s)
# if the snapshot exists
#
sub
restore_installed_db
()
{
if
(
-
d
$path_snapshot
)
{
kill_running_server
();
mtr_report
("
Restoring snapshot of databases
");
foreach
my
$data_dir
(
@data_dir_lst
)
{
my
$name
=
basename
(
$data_dir
);
rmtree
("
$data_dir
");
copy_dir
("
$path_snapshot
/
$name
",
"
$data_dir
");
}
if
(
$opt_with_ndbcluster
)
{
# Remove the ndb_*_fs dirs, forcing a clean start of ndb
rmtree
("
$path_ndb_data_dir
/ndb_1_fs
");
rmtree
("
$path_ndb_data_dir
/ndb_2_fs
");
if
(
$opt_with_ndbcluster_slave
)
{
# Remove also the ndb_*_fs dirs for slave cluster
rmtree
("
$path_ndb_slave_data_dir
/ndb_1_fs
");
}
}
}
else
{
# No snapshot existed, just stop all processes
stop_masters_slaves
();
}
}
sub
report_failure_and_restart
($)
{
sub
report_failure_and_restart
($)
{
my
$tinfo
=
shift
;
my
$tinfo
=
shift
;
...
@@ -2290,27 +2370,24 @@ sub report_failure_and_restart ($) {
...
@@ -2290,27 +2370,24 @@ sub report_failure_and_restart ($) {
mtr_report_test_failed
(
$tinfo
);
mtr_report_test_failed
(
$tinfo
);
mtr_show_failed_diff
(
$tinfo
->
{'
name
'});
mtr_show_failed_diff
(
$tinfo
->
{'
name
'});
print
"
\n
";
print
"
\n
";
if
(
!
$opt_force
)
if
(
$opt_force
)
{
{
my
$test_mode
=
join
("
",
@::glob_test_mode
)
||
"
default
";
# Restore the snapshot of the installed test db
print
"
Aborting:
$tinfo
->{'name'} failed in
$test_mode
mode.
";
restore_installed_db
();
print
"
To continue, re-run with '--force'.
\n
";
print
"
Resuming Tests
\n\n
";
if
(
!
$opt_gdb
and
!
$glob_use_running_server
and
return
;
!
$opt_ddd
and
!
$glob_use_embedded_server
)
{
stop_masters_slaves
();
}
mtr_exit
(
1
);
}
}
# FIXME always terminate on failure?!
my
$test_mode
=
join
("
",
@::glob_test_mode
)
||
"
default
";
print
"
Aborting:
$tinfo
->{'name'} failed in
$test_mode
mode.
";
print
"
To continue, re-run with '--force'.
\n
";
if
(
!
$opt_gdb
and
!
$glob_use_running_server
and
if
(
!
$opt_gdb
and
!
$glob_use_running_server
and
!
$opt_ddd
and
!
$glob_use_embedded_server
)
!
$opt_ddd
and
!
$glob_use_embedded_server
)
{
{
stop_masters_slaves
();
stop_masters_slaves
();
}
}
$glob_mysqld_restart
=
1
;
mtr_exit
(
1
)
;
print
"
Resuming Tests
\n\n
";
}
}
...
@@ -3046,7 +3123,8 @@ sub run_mysqltest ($) {
...
@@ -3046,7 +3123,8 @@ sub run_mysqltest ($) {
$ENV
{'
NDB_SLAVE_STATUS_OK
'}
=
$flag_ndb_slave_status_ok
;
$ENV
{'
NDB_SLAVE_STATUS_OK
'}
=
$flag_ndb_slave_status_ok
;
$ENV
{'
NDB_EXTRA_TEST
'}
=
$opt_ndb_extra_test
;
$ENV
{'
NDB_EXTRA_TEST
'}
=
$opt_ndb_extra_test
;
$ENV
{'
NDB_MGM
'}
=
$exe_ndb_mgm
;
$ENV
{'
NDB_MGM
'}
=
$exe_ndb_mgm
;
$ENV
{'
NDB_BACKUP_DIR
'}
=
$path_ndb_backup_dir
;
$ENV
{'
NDB_BACKUP_DIR
'}
=
$path_ndb_data_dir
;
$ENV
{'
NDB_DATA_DIR
'}
=
$path_ndb_data_dir
;
$ENV
{'
NDB_TOOLS_DIR
'}
=
$path_ndb_tools_dir
;
$ENV
{'
NDB_TOOLS_DIR
'}
=
$path_ndb_tools_dir
;
$ENV
{'
NDB_TOOLS_OUTPUT
'}
=
$file_ndb_testrun_log
;
$ENV
{'
NDB_TOOLS_OUTPUT
'}
=
$file_ndb_testrun_log
;
$ENV
{'
NDB_CONNECTSTRING
'}
=
$opt_ndbconnectstring
;
$ENV
{'
NDB_CONNECTSTRING
'}
=
$opt_ndbconnectstring
;
...
...
mysql-test/r/partition_list.result
View file @
43da9989
...
@@ -180,3 +180,14 @@ primary key(a,b))
...
@@ -180,3 +180,14 @@ primary key(a,b))
partition by list (a)
partition by list (a)
(partition x1 values in (1,2,9,4) tablespace ts1);
(partition x1 values in (1,2,9,4) tablespace ts1);
drop table t1;
drop table t1;
CREATE TABLE t1 (s1 int) PARTITION BY LIST (s1)
(PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2),
PARTITION p3 VALUES IN (3),
PARTITION p4 VALUES IN (4),
PARTITION p5 VALUES IN (5));
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT COUNT(*) FROM t1 WHERE s1 < 3;
COUNT(*)
2
DROP TABLE t1;
mysql-test/r/partition_range.result
View file @
43da9989
...
@@ -337,3 +337,29 @@ a b c
...
@@ -337,3 +337,29 @@ a b c
1 1 1
1 1 1
4 1 1
4 1 1
drop table t1;
drop table t1;
CREATE TABLE t1 (c1 int default NULL, c2 varchar(30) default NULL,
c3 date default NULL) engine=myisam
PARTITION BY RANGE (year(c3)) (PARTITION p0 VALUES LESS THAN (1995),
PARTITION p1 VALUES LESS THAN (1996) , PARTITION p2 VALUES LESS THAN (1997) ,
PARTITION p3 VALUES LESS THAN (1998) , PARTITION p4 VALUES LESS THAN (1999) ,
PARTITION p5 VALUES LESS THAN (2000) , PARTITION p6 VALUES LESS THAN (2001) ,
PARTITION p7 VALUES LESS THAN (2002) , PARTITION p8 VALUES LESS THAN (2003) ,
PARTITION p9 VALUES LESS THAN (2004) , PARTITION p10 VALUES LESS THAN (2010),
PARTITION p11 VALUES LESS THAN MAXVALUE );
INSERT INTO t1 VALUES (1, 'testing partitions', '1995-07-17'),
(3, 'testing partitions','1995-07-31'),
(5, 'testing partitions','1995-08-13'),
(7, 'testing partitions','1995-08-26'),
(9, 'testing partitions','1995-09-09'),
(0, 'testing partitions','2000-07-10'),
(2, 'testing partitions','2000-07-23'),
(4, 'testing partitions','2000-08-05'),
(6, 'testing partitions','2000-08-19'),
(8, 'testing partitions','2000-09-01');
SELECT COUNT(*) FROM t1 WHERE c3 BETWEEN '1996-12-31' AND '2000-12-31';
COUNT(*)
5
SELECT COUNT(*) FROM t1 WHERE c3 < '2000-12-31';
COUNT(*)
10
DROP TABLE t1;
mysql-test/t/partition_list.test
View file @
43da9989
...
@@ -110,3 +110,17 @@ partition by list (a)
...
@@ -110,3 +110,17 @@ partition by list (a)
(
partition
x1
values
in
(
1
,
2
,
9
,
4
)
tablespace
ts1
);
(
partition
x1
values
in
(
1
,
2
,
9
,
4
)
tablespace
ts1
);
drop
table
t1
;
drop
table
t1
;
#
#Bug #17173 Partitions: less-than search fails
#
CREATE
TABLE
t1
(
s1
int
)
PARTITION
BY
LIST
(
s1
)
(
PARTITION
p1
VALUES
IN
(
1
),
PARTITION
p2
VALUES
IN
(
2
),
PARTITION
p3
VALUES
IN
(
3
),
PARTITION
p4
VALUES
IN
(
4
),
PARTITION
p5
VALUES
IN
(
5
));
INSERT
INTO
t1
VALUES
(
1
),
(
2
),
(
3
),
(
4
),
(
5
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
s1
<
3
;
DROP
TABLE
t1
;
mysql-test/t/partition_range.test
View file @
43da9989
...
@@ -361,3 +361,30 @@ subpartition by hash (a+b)
...
@@ -361,3 +361,30 @@ subpartition by hash (a+b)
SELECT
*
from
t1
;
SELECT
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #17894 Comparison with "less than" operator fails with Range partition
#
CREATE
TABLE
t1
(
c1
int
default
NULL
,
c2
varchar
(
30
)
default
NULL
,
c3
date
default
NULL
)
engine
=
myisam
PARTITION
BY
RANGE
(
year
(
c3
))
(
PARTITION
p0
VALUES
LESS
THAN
(
1995
),
PARTITION
p1
VALUES
LESS
THAN
(
1996
)
,
PARTITION
p2
VALUES
LESS
THAN
(
1997
)
,
PARTITION
p3
VALUES
LESS
THAN
(
1998
)
,
PARTITION
p4
VALUES
LESS
THAN
(
1999
)
,
PARTITION
p5
VALUES
LESS
THAN
(
2000
)
,
PARTITION
p6
VALUES
LESS
THAN
(
2001
)
,
PARTITION
p7
VALUES
LESS
THAN
(
2002
)
,
PARTITION
p8
VALUES
LESS
THAN
(
2003
)
,
PARTITION
p9
VALUES
LESS
THAN
(
2004
)
,
PARTITION
p10
VALUES
LESS
THAN
(
2010
),
PARTITION
p11
VALUES
LESS
THAN
MAXVALUE
);
INSERT
INTO
t1
VALUES
(
1
,
'testing partitions'
,
'1995-07-17'
),
(
3
,
'testing partitions'
,
'1995-07-31'
),
(
5
,
'testing partitions'
,
'1995-08-13'
),
(
7
,
'testing partitions'
,
'1995-08-26'
),
(
9
,
'testing partitions'
,
'1995-09-09'
),
(
0
,
'testing partitions'
,
'2000-07-10'
),
(
2
,
'testing partitions'
,
'2000-07-23'
),
(
4
,
'testing partitions'
,
'2000-08-05'
),
(
6
,
'testing partitions'
,
'2000-08-19'
),
(
8
,
'testing partitions'
,
'2000-09-01'
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
c3
BETWEEN
'1996-12-31'
AND
'2000-12-31'
;
SELECT
COUNT
(
*
)
FROM
t1
WHERE
c3
<
'2000-12-31'
;
DROP
TABLE
t1
;
sql/opt_range.cc
View file @
43da9989
...
@@ -2430,6 +2430,7 @@ void store_key_image_to_rec(Field *field, char *ptr, uint len)
...
@@ -2430,6 +2430,7 @@ void store_key_image_to_rec(Field *field, char *ptr, uint len)
field
->
set_null
();
field
->
set_null
();
return
;
return
;
}
}
field
->
set_notnull
();
ptr
++
;
ptr
++
;
}
}
field
->
set_key_image
(
ptr
,
len
);
field
->
set_key_image
(
ptr
,
len
);
...
...
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