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
d4c7b6da
Commit
d4c7b6da
authored
Oct 23, 2006
by
ramil/ram@myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/usr/home/ram/work/mysql-5.1-maint
into mysql.com:/usr/home/ram/work/bug20732/my51-bug20732
parents
e8431818
800d8054
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
5 deletions
+29
-5
mysql-test/r/range.result
mysql-test/r/range.result
+10
-0
mysql-test/t/range.test
mysql-test/t/range.test
+11
-1
sql/opt_range.cc
sql/opt_range.cc
+5
-1
sql/opt_range.h
sql/opt_range.h
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+1
-1
sql/table.cc
sql/table.cc
+1
-1
No files found.
mysql-test/r/range.result
View file @
d4c7b6da
...
@@ -665,6 +665,16 @@ OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))
...
@@ -665,6 +665,16 @@ OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))
pk1 pk2 pk3 pk4 filler
pk1 pk2 pk3 pk4 filler
2621 2635 1000015 0 filler
2621 2635 1000015 0 filler
drop table t1, t2;
drop table t1, t2;
create table t1(a char(2), key(a(1)));
insert into t1 values ('x'), ('xx');
explain select a from t1 where a > 'x';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 2 NULL 2 Using where
select a from t1 where a > 'x';
a
xx
drop table t1;
End of 4.1 tests
CREATE TABLE t1 (
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
id int(11) NOT NULL auto_increment,
status varchar(20),
status varchar(20),
...
...
mysql-test/t/range.test
View file @
d4c7b6da
...
@@ -515,7 +515,17 @@ OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))
...
@@ -515,7 +515,17 @@ OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))
)
AND
(
pk3
>=
1000000
);
)
AND
(
pk3
>=
1000000
);
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
# End of 4.1 tests
#
# Bug #20732: Partial index and long sjis search with '>' fails sometimes
#
create
table
t1
(
a
char
(
2
),
key
(
a
(
1
)));
insert
into
t1
values
(
'x'
),
(
'xx'
);
explain
select
a
from
t1
where
a
>
'x'
;
select
a
from
t1
where
a
>
'x'
;
drop
table
t1
;
--
echo
End
of
4.1
tests
#
#
# Test for optimization request #10561: to use keys for
# Test for optimization request #10561: to use keys for
...
...
sql/opt_range.cc
View file @
d4c7b6da
...
@@ -2101,6 +2101,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
...
@@ -2101,6 +2101,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
key_parts
->
null_bit
=
key_part_info
->
null_bit
;
key_parts
->
null_bit
=
key_part_info
->
null_bit
;
key_parts
->
image_type
=
key_parts
->
image_type
=
(
key_info
->
flags
&
HA_SPATIAL
)
?
Field
::
itMBR
:
Field
::
itRAW
;
(
key_info
->
flags
&
HA_SPATIAL
)
?
Field
::
itMBR
:
Field
::
itRAW
;
key_parts
->
flag
=
key_part_info
->
key_part_flag
;
}
}
param
.
real_keynr
[
param
.
keys
++
]
=
idx
;
param
.
real_keynr
[
param
.
keys
++
]
=
idx
;
}
}
...
@@ -5655,7 +5656,9 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
...
@@ -5655,7 +5656,9 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
}
}
break
;
break
;
case
Item_func
:
:
GT_FUNC
:
case
Item_func
:
:
GT_FUNC
:
if
(
field_is_equal_to_item
(
field
,
value
))
/* Don't use open ranges for partial key_segments */
if
(
field_is_equal_to_item
(
field
,
value
)
&&
!
(
key_part
->
flag
&
HA_PART_KEY_SEG
))
tree
->
min_flag
=
NEAR_MIN
;
tree
->
min_flag
=
NEAR_MIN
;
/* fall through */
/* fall through */
case
Item_func
:
:
GE_FUNC
:
case
Item_func
:
:
GE_FUNC
:
...
@@ -7644,6 +7647,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
...
@@ -7644,6 +7647,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
key_part
->
length
=
key_info
->
key_part
[
part
].
length
;
key_part
->
length
=
key_info
->
key_part
[
part
].
length
;
key_part
->
store_length
=
key_info
->
key_part
[
part
].
store_length
;
key_part
->
store_length
=
key_info
->
key_part
[
part
].
store_length
;
key_part
->
null_bit
=
key_info
->
key_part
[
part
].
null_bit
;
key_part
->
null_bit
=
key_info
->
key_part
[
part
].
null_bit
;
key_part
->
flag
=
key_info
->
key_part
[
part
].
key_part_flag
;
}
}
if
(
insert_dynamic
(
&
quick
->
ranges
,(
gptr
)
&
range
))
if
(
insert_dynamic
(
&
quick
->
ranges
,(
gptr
)
&
range
))
goto
err
;
goto
err
;
...
...
sql/opt_range.h
View file @
d4c7b6da
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
typedef
struct
st_key_part
{
typedef
struct
st_key_part
{
uint16
key
,
part
,
store_length
,
length
;
uint16
key
,
part
,
store_length
,
length
;
uint8
null_bit
;
uint8
null_bit
,
flag
;
Field
*
field
;
Field
*
field
;
Field
::
imagetype
image_type
;
Field
::
imagetype
image_type
;
}
KEY_PART
;
}
KEY_PART
;
...
...
sql/sql_select.cc
View file @
d4c7b6da
...
@@ -11645,7 +11645,7 @@ part_of_refkey(TABLE *table,Field *field)
...
@@ -11645,7 +11645,7 @@ part_of_refkey(TABLE *table,Field *field)
for
(
uint
part
=
0
;
part
<
ref_parts
;
part
++
,
key_part
++
)
for
(
uint
part
=
0
;
part
<
ref_parts
;
part
++
,
key_part
++
)
if
(
field
->
eq
(
key_part
->
field
)
&&
if
(
field
->
eq
(
key_part
->
field
)
&&
!
(
key_part
->
key_part_flag
&
HA_PART_KEY_SEG
))
!
(
key_part
->
key_part_flag
&
(
HA_PART_KEY_SEG
|
HA_NULL_PART
)
))
return
table
->
reginfo
.
join_tab
->
ref
.
items
[
part
];
return
table
->
reginfo
.
join_tab
->
ref
.
items
[
part
];
}
}
return
(
Item
*
)
0
;
return
(
Item
*
)
0
;
...
...
sql/table.cc
View file @
d4c7b6da
...
@@ -1168,7 +1168,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
...
@@ -1168,7 +1168,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
as we need to test for NULL = NULL.
as we need to test for NULL = NULL.
*/
*/
if
(
field
->
real_maybe_null
())
if
(
field
->
real_maybe_null
())
key_part
->
key_part_flag
|=
HA_
PART_KEY_SEG
;
key_part
->
key_part_flag
|=
HA_
NULL_PART
;
}
}
keyinfo
->
usable_key_parts
=
usable_parts
;
// Filesort
keyinfo
->
usable_key_parts
=
usable_parts
;
// Filesort
...
...
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