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
3821a8df
Commit
3821a8df
authored
Nov 08, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb: bug#6435
fix null handling in ha_ndbcluster when using ordered index
parent
8acbd6a2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
5 deletions
+65
-5
mysql-test/r/ndb_index_ordered.result
mysql-test/r/ndb_index_ordered.result
+36
-1
mysql-test/t/ndb_index_ordered.test
mysql-test/t/ndb_index_ordered.test
+27
-1
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+2
-3
No files found.
mysql-test/r/ndb_index_ordered.result
View file @
3821a8df
drop table if exists t1;
drop table if exists t1
, test1, test2
;
CREATE TABLE t1 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
...
...
@@ -275,3 +275,38 @@ a b c
1 1 1
4 4 NULL
drop table t1;
CREATE TABLE test1 (
SubscrID int(11) NOT NULL auto_increment,
UsrID int(11) NOT NULL default '0',
PRIMARY KEY (SubscrID),
KEY idx_usrid (UsrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test1 VALUES (2,224),(3,224),(1,224);
CREATE TABLE test2 (
SbclID int(11) NOT NULL auto_increment,
SbcrID int(11) NOT NULL default '0',
PRIMARY KEY (SbclID),
KEY idx_sbcrid (SbcrID)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2);
select * from test1 order by 1;
SubscrID UsrID
1 224
2 224
3 224
select * from test2 order by 1;
SbclID SbcrID
1 1
2 1
3 2
4 2
SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON
l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2;
SubscrID SbclID
1 1
1 2
2 3
2 4
3 NULL
drop table test1;
drop table test2;
mysql-test/t/ndb_index_ordered.test
View file @
3821a8df
--
source
include
/
have_ndb
.
inc
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
,
test1
,
test2
;
--
enable_warnings
#
...
...
@@ -146,3 +146,29 @@ select * from t1 use index (bc) where b IS NULL and c = 2 order by a;
select
*
from
t1
use
index
(bc) where b < 4 order by a
;
select
*
from
t1
use
index
(bc) where b IS NOT NULL order by a
;
drop
table
t1
;
#
# Bug #6435
CREATE
TABLE
test1
(
SubscrID
int
(
11
)
NOT
NULL
auto_increment
,
UsrID
int
(
11
)
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
SubscrID
),
KEY
idx_usrid
(
UsrID
)
)
ENGINE
=
ndbcluster
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
test1
VALUES
(
2
,
224
),(
3
,
224
),(
1
,
224
);
CREATE
TABLE
test2
(
SbclID
int
(
11
)
NOT
NULL
auto_increment
,
SbcrID
int
(
11
)
NOT
NULL
default
'0'
,
PRIMARY
KEY
(
SbclID
),
KEY
idx_sbcrid
(
SbcrID
)
)
ENGINE
=
ndbcluster
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
test2
VALUES
(
3
,
2
),(
1
,
1
),(
2
,
1
),(
4
,
2
);
select
*
from
test1
order
by
1
;
select
*
from
test2
order
by
1
;
SELECT
s
.
SubscrID
,
l
.
SbclID
FROM
test1
s
left
JOIN
test2
l
ON
l
.
SbcrID
=
s
.
SubscrID
WHERE
s
.
UsrID
=
224
order
by
1
,
2
;
drop
table
test1
;
drop
table
test2
;
sql/ha_ndbcluster.cc
View file @
3821a8df
...
...
@@ -1290,7 +1290,6 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
Field
*
field
=
key_part
->
field
;
uint
part_len
=
key_part
->
length
;
uint
part_store_len
=
key_part
->
store_length
;
bool
part_nullable
=
(
bool
)
key_part
->
null_bit
;
// Info about each key part
struct
part_st
{
bool
part_last
;
...
...
@@ -1312,9 +1311,9 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op,
p
.
part_last
=
(
tot_len
+
part_store_len
>=
key_tot_len
[
j
]);
p
.
key
=
keys
[
j
];
p
.
part_ptr
=
&
p
.
key
->
key
[
tot_len
];
p
.
part_null
=
(
field
->
maybe_null
()
&&
*
p
.
part_ptr
)
;
p
.
part_null
=
key_part
->
null_bit
&&
*
p
.
part_ptr
;
p
.
bound_ptr
=
(
const
char
*
)
p
.
part_null
?
0
:
part_nullable
?
p
.
part_ptr
+
1
:
p
.
part_ptr
;
p
.
part_null
?
0
:
key_part
->
null_bit
?
p
.
part_ptr
+
1
:
p
.
part_ptr
;
if
(
j
==
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