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
cdc302fd
Commit
cdc302fd
authored
Dec 18, 2007
by
knielsen@loke.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.1-new-ndb
into loke.(none):/home/knielsen/devel/mysql-5.1-new-ndb-bug33061
parents
33721fd4
0ae0c133
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
15 deletions
+61
-15
mysql-test/suite/ndb/r/ndb_partition_key.result
mysql-test/suite/ndb/r/ndb_partition_key.result
+17
-0
mysql-test/suite/ndb/r/ndb_partition_range.result
mysql-test/suite/ndb/r/ndb_partition_range.result
+8
-0
mysql-test/suite/ndb/t/ndb_partition_key.test
mysql-test/suite/ndb/t/ndb_partition_key.test
+4
-0
mysql-test/suite/ndb/t/ndb_partition_range.test
mysql-test/suite/ndb/t/ndb_partition_range.test
+5
-0
storage/ndb/src/ndbapi/NdbScanOperation.cpp
storage/ndb/src/ndbapi/NdbScanOperation.cpp
+27
-15
No files found.
mysql-test/suite/ndb/r/ndb_partition_key.result
View file @
cdc302fd
...
...
@@ -38,6 +38,23 @@ a b c
1 10 3
1 11 3
1 12 3
select max(b) from t1 where a = 1;
max(b)
12
select b from t1 where a = 1 order by b desc;
b
12
11
10
9
8
7
6
5
4
3
2
1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
PRIMARY KEY (a,b,c) USING HASH)
...
...
mysql-test/suite/ndb/r/ndb_partition_range.result
View file @
cdc302fd
...
...
@@ -46,6 +46,14 @@ a b c
1 1 1
6 1 1
10 1 1
INSERT into t1 values (1, 2, 2);
select max(b) from t1 where a = 1;
max(b)
2
select b from t1 where a = 1 order by b desc;
b
2
1
drop table t1;
CREATE TABLE t1 (
a int not null,
...
...
mysql-test/suite/ndb/t/ndb_partition_key.test
View file @
cdc302fd
...
...
@@ -38,6 +38,10 @@ insert into t1 values
select
*
from
t1
order
by
b
;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
select
max
(
b
)
from
t1
where
a
=
1
;
select
b
from
t1
where
a
=
1
order
by
b
desc
;
DROP
TABLE
t1
;
#
...
...
mysql-test/suite/ndb/t/ndb_partition_range.test
View file @
cdc302fd
...
...
@@ -48,6 +48,11 @@ select * from t1 where a=21 order by a;
select
*
from
t1
where
a
in
(
1
,
6
,
10
,
21
)
order
by
a
;
select
*
from
t1
where
b
=
1
and
a
in
(
1
,
6
,
10
,
21
)
order
by
a
;
# BUG#33061: ORDER BY DESC becomes ASC in NDB partition pruning to one partition
INSERT
into
t1
values
(
1
,
2
,
2
);
select
max
(
b
)
from
t1
where
a
=
1
;
select
b
from
t1
where
a
=
1
order
by
b
desc
;
drop
table
t1
;
#
...
...
storage/ndb/src/ndbapi/NdbScanOperation.cpp
View file @
cdc302fd
...
...
@@ -1340,13 +1340,24 @@ NdbIndexScanOperation::readTuples(LockMode lm,
if
(
insertATTRINFO
(
word
)
==
-
1
)
res
=
-
1
;
}
if
(
!
res
&&
order_by
){
m_ordered
=
true
;
if
(
!
res
)
{
/**
* Note that it is valid to have order_desc true and order_by false.
*
* This means that there will be no merge sort among partitions, but
* each partition will still be returned in descending sort order.
*
* This is useful eg. if it is known that the scan spans only one
* partition.
*/
if
(
order_desc
)
{
m_descending
=
true
;
ScanTabReq
*
req
=
CAST_PTR
(
ScanTabReq
,
theSCAN_TABREQ
->
getDataPtrSend
());
ScanTabReq
::
setDescendingFlag
(
req
->
requestInfo
,
true
);
}
if
(
order_by
)
{
m_ordered
=
true
;
Uint32
cnt
=
m_accessTable
->
getNoOfColumns
()
-
1
;
m_sort_columns
=
cnt
;
// -1 for NDB$NODE
m_current_api_receiver
=
m_sent_receivers_count
;
...
...
@@ -1365,6 +1376,7 @@ NdbIndexScanOperation::readTuples(LockMode lm,
#endif
}
}
}
m_this_bound_start
=
0
;
m_first_bound_word
=
theKEYINFOptr
;
...
...
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