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
97954225
Commit
97954225
authored
Apr 07, 2014
by
andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-5996 - fix odd behaviour of some combinations of table and database names
parent
965bebcd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
1 deletion
+89
-1
storage/oqgraph/ha_oqgraph.cc
storage/oqgraph/ha_oqgraph.cc
+3
-1
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.inc
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.inc
+53
-0
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
+33
-0
No files found.
storage/oqgraph/ha_oqgraph.cc
View file @
97954225
...
...
@@ -557,9 +557,11 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
size_t
tlen
=
strlen
(
options
->
table_name
);
size_t
plen
=
(
int
)(
p
-
name
)
+
tlen
+
1
;
share
->
path
.
str
=
(
char
*
)
alloc_root
(
&
share
->
mem_root
,
plen
);
share
->
path
.
str
=
(
char
*
)
alloc_root
(
&
share
->
mem_root
,
plen
+
1
);
// MDEV-5996 space for trailing zero
// it seems there was a misunderstanding of why there is a separate length field in the String object
strmov
(
strnmov
(
share
->
path
.
str
,
name
,
(
int
)(
p
-
name
)
+
1
),
options
->
table_name
);
share
->
path
.
str
[
plen
]
=
0
;
// MDEV-5996 Make sure the pointer is zero terminated. I really think this needs refactoring, soon...
share
->
normalized_path
.
str
=
share
->
path
.
str
;
share
->
path
.
length
=
share
->
normalized_path
.
length
=
plen
;
...
...
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.inc
0 → 100644
View file @
97954225
# Regression test for https://mariadb.atlassian.net/browse/MDEV-5996
--
echo
Performing
OQGraph
regression
test
mdev5996
-
using
db
=
`$oqgraph_database_name`
,
table
=
`$oqgraph_table_name`
--
disable_warnings
use
test
;
if
(
$oqgraph_database_name
)
{
eval
drop
database
if
exists
`$oqgraph_database_name`
;
eval
create
database
`$oqgraph_database_name`
;
eval
use
`$oqgraph_database_name`
;
}
eval
drop
table
if
exists
`$oqgraph_table_name`
;
drop
table
if
exists
vvvvvvv_hhhhhhh
;
--
enable_warnings
eval
CREATE
TABLE
`$oqgraph_table_name`
(
`version`
varchar
(
10
)
NOT
NULL
,
`updateJSON`
mediumtext
,
`prevVersion`
varchar
(
10
)
NOT
NULL
,
`nodeID`
bigint
(
20
)
unsigned
NOT
NULL
DEFAULT
'0'
,
`prevNodeID`
bigint
(
20
)
unsigned
NOT
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`prevNodeID`
,
`nodeID`
),
KEY
`prevVersion`
(
`prevVersion`
)
USING
BTREE
,
KEY
`version`
(
`version`
)
USING
BTREE
,
KEY
`nodeID`
(
`nodeID`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
eval
insert
into
`$oqgraph_table_name`
values
(
'x'
,
'y'
,
'z'
,
0
,
0
);
eval
select
*
from
`$oqgraph_table_name`
;
eval
CREATE
TABLE
IF
NOT
EXISTS
vvvvvvv_hhhhhhh
(
latch
VARCHAR
(
32
)
NULL
,
origid
BIGINT
UNSIGNED
NULL
,
destid
BIGINT
UNSIGNED
NULL
,
weight
DOUBLE
NULL
,
seq
BIGINT
UNSIGNED
NULL
,
linkid
BIGINT
UNSIGNED
NULL
,
KEY
(
latch
,
origid
,
destid
)
USING
HASH
,
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
data_table
=
'$oqgraph_table_name'
origid
=
'prevNodeID'
destid
=
'nodeID'
;
select
*
from
vvvvvvv_hhhhhhh
;
eval
drop
table
if
exists
`$oqgraph_table_name`
;
drop
table
if
exists
vvvvvvv_hhhhhhh
;
if
(
$oqgraph_database_name
)
{
eval
drop
database
if
exists
`$oqgraph_database_name`
;
}
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
0 → 100644
View file @
97954225
# Regression test for https://mariadb.atlassian.net/browse/MDEV-5996
# MidSchipDB_unstable
--
let
$oqgraph_table_name
=
999999999
--
let
$oqgraph_database_name
=
--
source
regression_mdev5996
.
inc
--
let
$oqgraph_database_name
=
1
--
source
regression_mdev5996
.
inc
# Various cases - although actual bug was a broken zero termination
# name of backing store shorter, same and longer than table
--
let
$oqgraph_database_name
=
1112222233_4444444
--
source
regression_mdev5996
.
inc
--
let
$oqgraph_database_name
=
1112222233_44444444
--
source
regression_mdev5996
.
inc
--
let
$oqgraph_database_name
=
1112222233_444444444
--
source
regression_mdev5996
.
inc
--
let
$oqgraph_table_name
=
99999999
--
source
regression_mdev5996
.
inc
--
let
$oqgraph_table_name
=
9999999999
--
source
regression_mdev5996
.
inc
# Fails:
# 1/9999
# test/99999999
# 1112222233_444444444/999999999
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