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
4c6e8fc5
Commit
4c6e8fc5
authored
Jan 24, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results
disallow descending indexes in connect
parent
ae8600d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+9
-0
storage/connect/mysql-test/connect/r/index.result
storage/connect/mysql-test/connect/r/index.result
+9
-0
storage/connect/mysql-test/connect/t/index.test
storage/connect/mysql-test/connect/t/index.test
+10
-0
No files found.
storage/connect/ha_connect.cc
View file @
4c6e8fc5
...
...
@@ -1812,6 +1812,12 @@ PIXDEF ha_connect::GetIndexInfo(TABLE_SHARE *s)
pn
=
(
char
*
)
kp
.
key_part
[
k
].
field
->
field_name
.
str
;
name
=
PlugDup
(
g
,
pn
);
if
(
kp
.
key_part
[
k
].
key_part_flag
&
HA_REVERSE_SORT
)
{
strcpy
(
g
->
Message
,
"Descending indexes are not supported"
);
xdp
->
Invalid
=
true
;
}
// Allocate the key part description block
kpp
=
new
(
g
)
KPARTDEF
(
name
,
k
+
1
);
kpp
->
SetKlen
(
kp
.
key_part
[
k
].
length
);
...
...
@@ -6944,6 +6950,9 @@ int ha_connect::create(const char *name, TABLE *table_arg,
strcpy
(
g
->
Message
,
"Compressed tables are not indexable"
);
my_message
(
ER_UNKNOWN_ERROR
,
g
->
Message
,
MYF
(
0
));
rc
=
HA_ERR_UNSUPPORTED
;
}
else
if
(
xdp
->
Invalid
)
{
my_message
(
ER_UNKNOWN_ERROR
,
g
->
Message
,
MYF
(
0
));
rc
=
HA_ERR_UNSUPPORTED
;
}
else
if
(
GetIndexType
(
type
)
==
1
)
{
PDBUSER
dup
=
PlgGetUser
(
g
);
PCATLG
cat
=
(
dup
)
?
dup
->
Catalog
:
NULL
;
...
...
storage/connect/mysql-test/connect/r/index.result
View file @
4c6e8fc5
...
...
@@ -139,3 +139,12 @@ DELETE FROM t1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
#
# MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results
#
CREATE TABLE t1 (
id INT,
f VARCHAR(32),
PRIMARY KEY (id DESC)
) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='emp.txt';
ERROR HY000: Descending indexes are not supported
storage/connect/mysql-test/connect/t/index.test
View file @
4c6e8fc5
...
...
@@ -78,6 +78,16 @@ DROP TABLE t1;
DROP
TABLE
t2
;
DROP
TABLE
t3
;
--
echo
#
--
echo
# MDEV-27591 Connect tables (FIX/DOS) don't work with DESC keys - wrong results
--
echo
#
--
error
ER_UNKNOWN_ERROR
CREATE
TABLE
t1
(
id
INT
,
f
VARCHAR
(
32
),
PRIMARY
KEY
(
id
DESC
)
)
ENGINE
=
CONNECT
TABLE_TYPE
=
DOS
FILE_NAME
=
'emp.txt'
;
#
# Clean up
#
...
...
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