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
918f5244
Commit
918f5244
authored
Dec 16, 2021
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RocksDB doesn't support DESC indexes yet
disallow descending indexes in rocksdb
parent
fca37e49
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
5 deletions
+24
-5
storage/rocksdb/ha_rocksdb.cc
storage/rocksdb/ha_rocksdb.cc
+1
-2
storage/rocksdb/mysql-test/rocksdb/r/index_key_block_size.result
.../rocksdb/mysql-test/rocksdb/r/index_key_block_size.result
+5
-0
storage/rocksdb/mysql-test/rocksdb/t/index_key_block_size.test
...ge/rocksdb/mysql-test/rocksdb/t/index_key_block_size.test
+6
-0
storage/rocksdb/rdb_datadic.cc
storage/rocksdb/rdb_datadic.cc
+11
-2
storage/rocksdb/rdb_datadic.h
storage/rocksdb/rdb_datadic.h
+1
-1
No files found.
storage/rocksdb/ha_rocksdb.cc
View file @
918f5244
...
@@ -7533,8 +7533,7 @@ int ha_rocksdb::create_key_def(const TABLE *const table_arg, const uint i,
...
@@ -7533,8 +7533,7 @@ int ha_rocksdb::create_key_def(const TABLE *const table_arg, const uint i,
(
*
new_key_def
)
->
m_ttl_column
=
ttl_column
;
(
*
new_key_def
)
->
m_ttl_column
=
ttl_column
;
}
}
// initialize key_def
// initialize key_def
(
*
new_key_def
)
->
setup
(
table_arg
,
tbl_def_arg
);
DBUG_RETURN
((
*
new_key_def
)
->
setup
(
table_arg
,
tbl_def_arg
));
DBUG_RETURN
(
HA_EXIT_SUCCESS
);
}
}
int
rdb_normalize_tablename
(
const
std
::
string
&
tablename
,
int
rdb_normalize_tablename
(
const
std
::
string
&
tablename
,
...
...
storage/rocksdb/mysql-test/rocksdb/r/index_key_block_size.result
View file @
918f5244
...
@@ -23,6 +23,11 @@ CREATE TABLE t1 (a INT,
...
@@ -23,6 +23,11 @@ CREATE TABLE t1 (a INT,
b CHAR(8),
b CHAR(8),
PRIMARY KEY ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
PRIMARY KEY ind2(b(1) DESC) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
) ENGINE=rocksdb;
) ENGINE=rocksdb;
ERROR HY000: Table storage engine 'ROCKSDB' does not support the create option 'DESC'
CREATE TABLE t1 (a INT,
b CHAR(8),
PRIMARY KEY ind2(b(1)) KEY_BLOCK_SIZE=32768 COMMENT 'big key_block_size value'
) ENGINE=rocksdb;
Warnings:
Warnings:
Warning 1280 Name 'ind2' ignored for PRIMARY key.
Warning 1280 Name 'ind2' ignored for PRIMARY key.
SHOW INDEX IN t1;
SHOW INDEX IN t1;
...
...
storage/rocksdb/mysql-test/rocksdb/t/index_key_block_size.test
View file @
918f5244
...
@@ -28,11 +28,17 @@ CREATE TABLE t1 (a INT,
...
@@ -28,11 +28,17 @@ CREATE TABLE t1 (a INT,
SHOW
INDEX
IN
t1
;
SHOW
INDEX
IN
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
error
ER_ILLEGAL_HA_CREATE_OPTION
CREATE
TABLE
t1
(
a
INT
,
CREATE
TABLE
t1
(
a
INT
,
b
CHAR
(
8
),
b
CHAR
(
8
),
PRIMARY
KEY
ind2
(
b
(
1
)
DESC
)
KEY_BLOCK_SIZE
=
32768
COMMENT
'big key_block_size value'
PRIMARY
KEY
ind2
(
b
(
1
)
DESC
)
KEY_BLOCK_SIZE
=
32768
COMMENT
'big key_block_size value'
)
ENGINE
=
rocksdb
;
)
ENGINE
=
rocksdb
;
CREATE
TABLE
t1
(
a
INT
,
b
CHAR
(
8
),
PRIMARY
KEY
ind2
(
b
(
1
))
KEY_BLOCK_SIZE
=
32768
COMMENT
'big key_block_size value'
)
ENGINE
=
rocksdb
;
--
replace_column
7
#
--
replace_column
7
#
SHOW
INDEX
IN
t1
;
SHOW
INDEX
IN
t1
;
...
...
storage/rocksdb/rdb_datadic.cc
View file @
918f5244
...
@@ -390,7 +390,7 @@ Rdb_key_def::~Rdb_key_def() {
...
@@ -390,7 +390,7 @@ Rdb_key_def::~Rdb_key_def() {
m_pack_info
=
nullptr
;
m_pack_info
=
nullptr
;
}
}
void
Rdb_key_def
::
setup
(
const
TABLE
*
const
tbl
,
uint
Rdb_key_def
::
setup
(
const
TABLE
*
const
tbl
,
const
Rdb_tbl_def
*
const
tbl_def
)
{
const
Rdb_tbl_def
*
const
tbl_def
)
{
DBUG_ASSERT
(
tbl
!=
nullptr
);
DBUG_ASSERT
(
tbl
!=
nullptr
);
DBUG_ASSERT
(
tbl_def
!=
nullptr
);
DBUG_ASSERT
(
tbl_def
!=
nullptr
);
...
@@ -406,7 +406,7 @@ void Rdb_key_def::setup(const TABLE *const tbl,
...
@@ -406,7 +406,7 @@ void Rdb_key_def::setup(const TABLE *const tbl,
RDB_MUTEX_LOCK_CHECK
(
m_mutex
);
RDB_MUTEX_LOCK_CHECK
(
m_mutex
);
if
(
m_maxlength
!=
0
)
{
if
(
m_maxlength
!=
0
)
{
RDB_MUTEX_UNLOCK_CHECK
(
m_mutex
);
RDB_MUTEX_UNLOCK_CHECK
(
m_mutex
);
return
;
return
HA_EXIT_SUCCESS
;
}
}
KEY
*
key_info
=
nullptr
;
KEY
*
key_info
=
nullptr
;
...
@@ -488,6 +488,14 @@ void Rdb_key_def::setup(const TABLE *const tbl,
...
@@ -488,6 +488,14 @@ void Rdb_key_def::setup(const TABLE *const tbl,
for
(
uint
src_i
=
0
;
src_i
<
m_key_parts
;
src_i
++
,
keypart_to_set
++
)
{
for
(
uint
src_i
=
0
;
src_i
<
m_key_parts
;
src_i
++
,
keypart_to_set
++
)
{
Field
*
const
field
=
key_part
?
key_part
->
field
:
nullptr
;
Field
*
const
field
=
key_part
?
key_part
->
field
:
nullptr
;
if
(
key_part
&&
key_part
->
key_part_flag
&
HA_REVERSE_SORT
)
{
my_error
(
ER_ILLEGAL_HA_CREATE_OPTION
,
MYF
(
0
),
"ROCKSDB"
,
"DESC"
);
RDB_MUTEX_UNLOCK_CHECK
(
m_mutex
);
return
HA_EXIT_FAILURE
;
}
if
(
simulating_extkey
&&
!
hidden_pk_exists
)
{
if
(
simulating_extkey
&&
!
hidden_pk_exists
)
{
DBUG_ASSERT
(
secondary_key
);
DBUG_ASSERT
(
secondary_key
);
/* Check if this field is already present in the key definition */
/* Check if this field is already present in the key definition */
...
@@ -591,6 +599,7 @@ void Rdb_key_def::setup(const TABLE *const tbl,
...
@@ -591,6 +599,7 @@ void Rdb_key_def::setup(const TABLE *const tbl,
RDB_MUTEX_UNLOCK_CHECK
(
m_mutex
);
RDB_MUTEX_UNLOCK_CHECK
(
m_mutex
);
}
}
return
HA_EXIT_SUCCESS
;
}
}
/*
/*
...
...
storage/rocksdb/rdb_datadic.h
View file @
918f5244
...
@@ -593,7 +593,7 @@ class Rdb_key_def {
...
@@ -593,7 +593,7 @@ class Rdb_key_def {
SECONDARY_FORMAT_VERSION_UPDATE3
=
65535
,
SECONDARY_FORMAT_VERSION_UPDATE3
=
65535
,
};
};
void
setup
(
const
TABLE
*
const
table
,
const
Rdb_tbl_def
*
const
tbl_def
);
uint
setup
(
const
TABLE
*
const
table
,
const
Rdb_tbl_def
*
const
tbl_def
);
static
uint
extract_ttl_duration
(
const
TABLE
*
const
table_arg
,
static
uint
extract_ttl_duration
(
const
TABLE
*
const
table_arg
,
const
Rdb_tbl_def
*
const
tbl_def_arg
,
const
Rdb_tbl_def
*
const
tbl_def_arg
,
...
...
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