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
d8b693a3
Commit
d8b693a3
authored
May 02, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-ndb
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1-new-ndb
parents
55153730
deab2c1a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
2 deletions
+56
-2
mysql-test/r/ndb_insert.result
mysql-test/r/ndb_insert.result
+8
-0
mysql-test/t/ndb_insert.test
mysql-test/t/ndb_insert.test
+9
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+38
-1
storage/ndb/src/kernel/error/TimeModule.cpp
storage/ndb/src/kernel/error/TimeModule.cpp
+1
-1
No files found.
mysql-test/r/ndb_insert.result
View file @
d8b693a3
...
...
@@ -649,3 +649,11 @@ pk a
6 NULL
7 4
DROP TABLE t1;
create table t1(a int primary key, b int, unique key(b)) engine=ndb;
insert ignore into t1 values (1,0), (2,0), (2,null), (3,null);
select * from t1 order by a;
a b
1 0
2 NULL
3 NULL
drop table t1;
mysql-test/t/ndb_insert.test
View file @
d8b693a3
...
...
@@ -630,4 +630,13 @@ INSERT IGNORE INTO t1 VALUES (4,NULL),(5,NULL),(6,NULL),(7,4);
SELECT
*
FROM
t1
ORDER
BY
pk
;
DROP
TABLE
t1
;
#
# Bug #27980 INSERT IGNORE wrongly ignores NULLs in unique index
#
create
table
t1
(
a
int
primary
key
,
b
int
,
unique
key
(
b
))
engine
=
ndb
;
insert
ignore
into
t1
values
(
1
,
0
),
(
2
,
0
),
(
2
,
null
),
(
3
,
null
);
select
*
from
t1
order
by
a
;
drop
table
t1
;
# End of 4.1 tests
sql/ha_ndbcluster.cc
View file @
d8b693a3
...
...
@@ -1909,6 +1909,33 @@ bool ha_ndbcluster::check_all_operations_for_error(NdbTransaction *trans,
}
/**
* Check if record contains any null valued columns that are part of a key
*/
static
int
check_null_in_record
(
const
KEY
*
key_info
,
const
byte
*
record
)
{
KEY_PART_INFO
*
curr_part
,
*
end_part
;
curr_part
=
key_info
->
key_part
;
end_part
=
curr_part
+
key_info
->
key_parts
;
while
(
curr_part
!=
end_part
)
{
if
(
curr_part
->
null_bit
&&
(
record
[
curr_part
->
null_offset
]
&
curr_part
->
null_bit
))
return
1
;
curr_part
++
;
}
return
0
;
/*
We could instead pre-compute a bitmask in table_share with one bit for
every null-bit in the key, and so check this just by OR'ing the bitmask
with the null bitmap in the record.
But not sure it's worth it.
*/
}
/*
* Peek to check if any rows already exist with conflicting
* primary key or unique index values
...
...
@@ -1966,7 +1993,17 @@ int ha_ndbcluster::peek_indexed_rows(const byte *record,
if
(
i
!=
table
->
s
->
primary_key
&&
key_info
->
flags
&
HA_NOSAME
)
{
// A unique index is defined on table
/*
A unique index is defined on table.
We cannot look up a NULL field value in a unique index. But since
keys with NULLs are not indexed, such rows cannot conflict anyway, so
we just skip the index in this case.
*/
if
(
check_null_in_record
(
key_info
,
record
))
{
DBUG_PRINT
(
"info"
,
(
"skipping check for key with NULL"
));
continue
;
}
NdbIndexOperation
*
iop
;
const
NDBINDEX
*
unique_index
=
m_index
[
i
].
unique_index
;
key_part
=
key_info
->
key_part
;
...
...
storage/ndb/src/kernel/error/TimeModule.cpp
View file @
d8b693a3
...
...
@@ -18,7 +18,7 @@
#include <ndb_global.h>
#include "TimeModule.hpp"
static
const
char
*
cMonth
[]
=
{
"x"
,
"January"
,
"February"
,
"Mar
s
"
,
"April"
,
"May"
,
"June"
,
static
const
char
*
cMonth
[]
=
{
"x"
,
"January"
,
"February"
,
"Mar
ch
"
,
"April"
,
"May"
,
"June"
,
"July"
,
"August"
,
"September"
,
"October"
,
"November"
,
"December"
};
static
const
char
*
cDay
[]
=
{
"Sunday"
,
"Monday"
,
"Tuesday"
,
"Wednesday"
,
"Thursday"
,
"Friday"
,
...
...
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