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
5f8cfacf
Commit
5f8cfacf
authored
Oct 08, 2009
by
Frazer Clement
Browse files
Options
Browse Files
Download
Plain Diff
Merge 5.0-bugteam-> 5.1-bugteam
parents
d9ce9f21
844eb557
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
4 deletions
+27
-4
client/mysqltest.cc
client/mysqltest.cc
+2
-3
mysql-test/r/type_bit.result
mysql-test/r/type_bit.result
+10
-0
mysql-test/t/type_bit.test
mysql-test/t/type_bit.test
+11
-0
sql/opt_range.cc
sql/opt_range.cc
+4
-1
No files found.
client/mysqltest.cc
View file @
5f8cfacf
...
@@ -6775,8 +6775,10 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
...
@@ -6775,8 +6775,10 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
MYSQL_STMT
*
stmt
;
MYSQL_STMT
*
stmt
;
DYNAMIC_STRING
ds_prepare_warnings
;
DYNAMIC_STRING
ds_prepare_warnings
;
DYNAMIC_STRING
ds_execute_warnings
;
DYNAMIC_STRING
ds_execute_warnings
;
ulonglong
affected_rows
;
DBUG_ENTER
(
"run_query_stmt"
);
DBUG_ENTER
(
"run_query_stmt"
);
DBUG_PRINT
(
"query"
,
(
"'%-.60s'"
,
query
));
DBUG_PRINT
(
"query"
,
(
"'%-.60s'"
,
query
));
LINT_INIT
(
affected_rows
);
/*
/*
Init a new stmt if it's not already one created for this connection
Init a new stmt if it's not already one created for this connection
...
@@ -6911,9 +6913,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
...
@@ -6911,9 +6913,6 @@ void run_query_stmt(MYSQL *mysql, struct st_command *command,
Need to grab affected rows information before getting
Need to grab affected rows information before getting
warnings here
warnings here
*/
*/
ulonglong
affected_rows
;
LINT_INIT
(
affected_rows
);
if
(
!
disable_info
)
if
(
!
disable_info
)
affected_rows
=
mysql_affected_rows
(
mysql
);
affected_rows
=
mysql_affected_rows
(
mysql
);
...
...
mysql-test/r/type_bit.result
View file @
5f8cfacf
...
@@ -749,6 +749,16 @@ bin(a1)
...
@@ -749,6 +749,16 @@ bin(a1)
110000111111111
110000111111111
110001011111111
110001011111111
drop table t1bit7, t2bit7;
drop table t1bit7, t2bit7;
#
# Bug42803: Field_bit does not have unsigned_flag field,
# can lead to bad memory access
#
CREATE TABLE t1 (a BIT(7), b BIT(9), KEY(a, b));
INSERT INTO t1 VALUES(0, 0), (5, 3), (5, 6), (6, 4), (7, 0);
EXPLAIN SELECT a+0, b+0 FROM t1 WHERE a > 4 and b < 7 ORDER BY 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 2 NULL 4 Using where; Using index; Using filesort
DROP TABLE t1;
End of 5.0 tests
End of 5.0 tests
create table t1(a bit(7));
create table t1(a bit(7));
insert into t1 values(0x40);
insert into t1 values(0x40);
...
...
mysql-test/t/type_bit.test
View file @
5f8cfacf
...
@@ -397,6 +397,17 @@ insert into t2bit7 values (b'110011011111111');
...
@@ -397,6 +397,17 @@ insert into t2bit7 values (b'110011011111111');
select
bin
(
a1
)
from
t1bit7
,
t2bit7
where
t1bit7
.
a1
=
t2bit7
.
b1
;
select
bin
(
a1
)
from
t1bit7
,
t2bit7
where
t1bit7
.
a1
=
t2bit7
.
b1
;
drop
table
t1bit7
,
t2bit7
;
drop
table
t1bit7
,
t2bit7
;
--
echo
#
--
echo
# Bug42803: Field_bit does not have unsigned_flag field,
--
echo
# can lead to bad memory access
--
echo
#
CREATE
TABLE
t1
(
a
BIT
(
7
),
b
BIT
(
9
),
KEY
(
a
,
b
));
INSERT
INTO
t1
VALUES
(
0
,
0
),
(
5
,
3
),
(
5
,
6
),
(
6
,
4
),
(
7
,
0
);
EXPLAIN
SELECT
a
+
0
,
b
+
0
FROM
t1
WHERE
a
>
4
and
b
<
7
ORDER
BY
2
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
#
#
...
...
sql/opt_range.cc
View file @
5f8cfacf
...
@@ -5876,6 +5876,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
...
@@ -5876,6 +5876,7 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
if
(
type
==
Item_func
::
LT_FUNC
&&
(
value
->
val_int
()
>
0
))
if
(
type
==
Item_func
::
LT_FUNC
&&
(
value
->
val_int
()
>
0
))
type
=
Item_func
::
LE_FUNC
;
type
=
Item_func
::
LE_FUNC
;
else
if
(
type
==
Item_func
::
GT_FUNC
&&
else
if
(
type
==
Item_func
::
GT_FUNC
&&
(
field
->
type
()
!=
FIELD_TYPE_BIT
)
&&
!
((
Field_num
*
)
field
)
->
unsigned_flag
&&
!
((
Field_num
*
)
field
)
->
unsigned_flag
&&
!
((
Item_int
*
)
value
)
->
unsigned_flag
&&
!
((
Item_int
*
)
value
)
->
unsigned_flag
&&
(
value
->
val_int
()
<
0
))
(
value
->
val_int
()
<
0
))
...
@@ -5913,7 +5914,9 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
...
@@ -5913,7 +5914,9 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
*/
*/
if
(
field
->
result_type
()
==
INT_RESULT
&&
if
(
field
->
result_type
()
==
INT_RESULT
&&
value
->
result_type
()
==
INT_RESULT
&&
value
->
result_type
()
==
INT_RESULT
&&
((
Field_num
*
)
field
)
->
unsigned_flag
&&
!
((
Item_int
*
)
value
)
->
unsigned_flag
)
((
field
->
type
()
==
FIELD_TYPE_BIT
||
((
Field_num
*
)
field
)
->
unsigned_flag
)
&&
!
((
Item_int
*
)
value
)
->
unsigned_flag
))
{
{
longlong
item_val
=
value
->
val_int
();
longlong
item_val
=
value
->
val_int
();
if
(
item_val
<
0
)
if
(
item_val
<
0
)
...
...
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