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
6cb23b94
Commit
6cb23b94
authored
Nov 28, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
merge with 4.0 to get fix for range bug
libmysql/libmysql.c: Auto merged sql/opt_range.cc: Auto merged
parents
aa780843
15763ed5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
+22
-6
libmysql/libmysql.c
libmysql/libmysql.c
+0
-5
mysql-test/r/range.result
mysql-test/r/range.result
+10
-0
mysql-test/t/range.test
mysql-test/t/range.test
+11
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-1
No files found.
libmysql/libmysql.c
View file @
6cb23b94
...
@@ -827,8 +827,6 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
...
@@ -827,8 +827,6 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
else
if
(
parent
->
options
.
db
)
else
if
(
parent
->
options
.
db
)
child
->
options
.
db
=
my_strdup
(
parent
->
options
.
db
,
MYF
(
0
));
child
->
options
.
db
=
my_strdup
(
parent
->
options
.
db
,
MYF
(
0
));
child
->
options
.
rpl_parse
=
child
->
options
.
rpl_probe
=
child
->
rpl_pivot
=
0
;
return
child
;
return
child
;
}
}
...
@@ -842,9 +840,6 @@ STDCALL mysql_set_master(MYSQL* mysql, const char* host,
...
@@ -842,9 +840,6 @@ STDCALL mysql_set_master(MYSQL* mysql, const char* host,
mysql_close
(
mysql
->
master
);
mysql_close
(
mysql
->
master
);
if
(
!
(
mysql
->
master
=
spawn_init
(
mysql
,
host
,
port
,
user
,
passwd
)))
if
(
!
(
mysql
->
master
=
spawn_init
(
mysql
,
host
,
port
,
user
,
passwd
)))
return
1
;
return
1
;
mysql
->
master
->
rpl_pivot
=
0
;
mysql
->
master
->
options
.
rpl_parse
=
0
;
mysql
->
master
->
options
.
rpl_probe
=
0
;
return
0
;
return
0
;
}
}
...
...
mysql-test/r/range.result
View file @
6cb23b94
...
@@ -279,6 +279,16 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -279,6 +279,16 @@ id select_type table type possible_keys key key_len ref rows Extra
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
a b
a b
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
INSERT INTO t1 VALUES (1,0,0),(1,0,0),(1,0,0);
INSERT INTO t1 VALUES (0,1,0),(0,1,0),(0,1,0);
SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
COUNT(*)
6
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*)
6
DROP TABLE t1;
create table t1 (id int(10) primary key);
create table t1 (id int(10) primary key);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9);
select id from t1 where id in (2,5,9) ;
select id from t1 where id in (2,5,9) ;
...
...
mysql-test/t/range.test
View file @
6cb23b94
...
@@ -226,7 +226,18 @@ INSERT INTO t1 VALUES
...
@@ -226,7 +226,18 @@ INSERT INTO t1 VALUES
# we expect that optimizer will choose index on A
# we expect that optimizer will choose index on A
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
IN
(
1
,
2
)
AND
b
=
5
;
EXPLAIN
SELECT
*
FROM
t1
WHERE
a
IN
(
1
,
2
)
AND
b
=
5
;
SELECT
*
FROM
t1
WHERE
a
IN
(
1
,
2
)
AND
b
=
5
;
SELECT
*
FROM
t1
WHERE
a
IN
(
1
,
2
)
AND
b
=
5
;
DROP
TABLE
t1
;
#
# Test error with
#
CREATE
TABLE
t1
(
a
int
,
b
int
,
c
int
,
INDEX
(
c
,
a
,
b
));
INSERT
INTO
t1
VALUES
(
1
,
0
,
0
),(
1
,
0
,
0
),(
1
,
0
,
0
);
INSERT
INTO
t1
VALUES
(
0
,
1
,
0
),(
0
,
1
,
0
),(
0
,
1
,
0
);
# -- First reports 3; second reports 6
SELECT
COUNT
(
*
)
FROM
t1
WHERE
(
c
=
0
and
a
=
1
)
or
(
c
=
0
and
b
=
1
);
SELECT
COUNT
(
*
)
FROM
t1
WHERE
(
c
=
0
and
b
=
1
)
or
(
c
=
0
and
a
=
1
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# test for a bug with in() and unique key
# test for a bug with in() and unique key
...
...
sql/opt_range.cc
View file @
6cb23b94
...
@@ -68,7 +68,7 @@ class SEL_ARG :public Sql_alloc
...
@@ -68,7 +68,7 @@ class SEL_ARG :public Sql_alloc
{}
{}
inline
bool
is_same
(
SEL_ARG
*
arg
)
inline
bool
is_same
(
SEL_ARG
*
arg
)
{
{
if
(
type
!=
arg
->
type
)
if
(
type
!=
arg
->
type
||
part
!=
arg
->
part
)
return
0
;
return
0
;
if
(
type
!=
KEY_RANGE
)
if
(
type
!=
KEY_RANGE
)
return
1
;
return
1
;
...
...
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