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
e1af5fb2
Commit
e1af5fb2
authored
Nov 22, 2002
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with indexed NULL column <=> NULL
Fix for Mac OS X shutdown
parent
541c40b0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
7 deletions
+56
-7
mysql-test/mysql-test-run.sh
mysql-test/mysql-test-run.sh
+2
-1
mysql-test/r/null_key.result
mysql-test/r/null_key.result
+17
-0
mysql-test/t/null_key.test
mysql-test/t/null_key.test
+21
-0
sql/mysqld.cc
sql/mysqld.cc
+4
-0
sql/opt_range.cc
sql/opt_range.cc
+12
-6
No files found.
mysql-test/mysql-test-run.sh
View file @
e1af5fb2
...
...
@@ -249,6 +249,7 @@ SLAVE_MYPID="$MYRUN_DIR/mysqld-slave.pid"
SLAVE_MYLOG
=
"
$MYSQL_TEST_DIR
/var/log/mysqld-slave.log"
SLAVE_MYERR
=
"
$MYSQL_TEST_DIR
/var/log/mysqld-slave.err"
CLIENT_MYLOG
=
"
$MYSQL_TEST_DIR
/var/log/client.log"
SMALL_SERVER
=
"-O key_buffer_size=1M -O sort_buffer=256K -O max_heap_table_size=1M"
export
MASTER_MYPORT
...
...
@@ -344,7 +345,7 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov
#--
wait_for_server_start
()
{
$MYSQLADMIN
--no-defaults
-u
$DBUSER
--silent
-O
connect_timeout
=
10
-w3
--host
=
$hostname
--port
=
$1
ping
>
/dev/null
2>&1
$MYSQLADMIN
--no-defaults
-u
$DBUSER
--silent
-O
connect_timeout
=
10
-w3
--host
=
$hostname
--port
=
$1
ping
>
>
$CLIENT_MYLOG
2>&1
exit_code
=
$?
if
[
$exit_code
!=
0
]
;
then
echo
"Error: Could not start
$2
, exit code
$exit_code
"
;
...
...
mysql-test/r/null_key.result
View file @
e1af5fb2
...
...
@@ -126,3 +126,20 @@ order_id product_id product_type
3d7ce39b5d4b3e3d22aaafe9b633de51 5880836 3
id id
id id
id id2
NULL 0
1 1
id id2
NULL 0
id id2
NULL 0
1 1
id id2
NULL 0
1 1
id id2
1 1
id id2
1 1
id id2
1 1
mysql-test/t/null_key.test
View file @
e1af5fb2
...
...
@@ -135,3 +135,24 @@ select * from t1, t2 where t1.id = t2.id;
alter
table
t1
add
key
id
(
id
);
select
*
from
t1
,
t2
where
t1
.
id
=
t2
.
id
;
drop
table
t1
,
t2
;
#
# Check bug when doing <=> NULL on an indexed null field
#
create
table
t1
(
id
integer
,
id2
integer
not
null
,
index
(
id
),
index
(
id2
)
);
insert
into
t1
values
(
null
,
null
),(
1
,
1
);
select
*
from
t1
;
select
*
from
t1
where
id
<=>
null
;
select
*
from
t1
where
id
<=>
null
or
id
>
0
;
select
*
from
t1
where
id
is
null
or
id
>
0
;
select
*
from
t1
where
id2
<=>
null
or
id2
>
0
;
select
*
from
t1
where
id2
is
null
or
id2
>
0
;
delete
from
t1
where
id
<=>
NULL
;
select
*
from
t1
;
drop
table
t1
;
sql/mysqld.cc
View file @
e1af5fb2
...
...
@@ -739,7 +739,11 @@ static sig_handler print_signal_warning(int sig)
void
unireg_end
(
int
signal_number
__attribute__
((
unused
)))
{
clean_up
();
#ifdef SIGNALS_DONT_BREAK_READ
exit
(
0
);
#else
pthread_exit
(
0
);
// Exit is in main thread
#endif
}
...
...
sql/opt_range.cc
View file @
e1af5fb2
...
...
@@ -931,8 +931,11 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
if
(
!
(
res
=
value
->
val_str
(
&
tmp
)))
DBUG_RETURN
(
&
null_element
);
// Check if this was a function. This should have be optimized away
// in the sql_select.cc
/*
TODO:
Check if this was a function. This should have be optimized away
in the sql_select.cc
*/
if
(
res
!=
&
tmp
)
{
tmp
.
copy
(
*
res
);
// Get own copy
...
...
@@ -1011,8 +1014,10 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
type
!=
Item_func
::
EQUAL_FUNC
)
DBUG_RETURN
(
0
);
// Can't optimize this
/* We can't always use indexes when comparing a string index to a number */
/* cmp_type() is checked to allow compare of dates to numbers */
/*
We can't always use indexes when comparing a string index to a number
cmp_type() is checked to allow compare of dates to numbers
*/
if
(
field
->
result_type
()
==
STRING_RESULT
&&
value
->
result_type
()
!=
STRING_RESULT
&&
field
->
cmp_type
()
!=
value
->
result_type
())
...
...
@@ -1020,6 +1025,7 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
if
(
value
->
save_in_field
(
field
))
{
/* This happens when we try to insert a NULL field in a not null column */
if
(
type
==
Item_func
::
EQUAL_FUNC
)
{
/* convert column_name <=> NULL -> column_name IS NULL */
...
...
@@ -1029,14 +1035,14 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
*
str
=
1
;
DBUG_RETURN
(
new
SEL_ARG
(
field
,
str
,
str
));
}
DBUG_RETURN
(
&
null_element
);
// NULL is never true
DBUG_RETURN
(
&
null_element
);
//
cmp with
NULL is never true
}
// Get local copy of key
char
*
str
=
(
char
*
)
sql_alloc
(
key_part
->
part_length
+
maybe_null
);
if
(
!
str
)
DBUG_RETURN
(
0
);
if
(
maybe_null
)
*
str
=
0
;
// Not NULL
*
str
=
(
char
)
field
->
is_real_null
();
// Set to 1 if null
field
->
get_key_image
(
str
+
maybe_null
,
key_part
->
part_length
);
if
(
!
(
tree
=
new
SEL_ARG
(
field
,
str
,
str
)))
DBUG_RETURN
(
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