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
9459746a
Commit
9459746a
authored
May 31, 2013
by
Andrew McDonnell
Browse files
Options
Browse Files
Download
Plain Diff
Fix for assert in debug build, and update test case
parents
83a23f31
1b4164c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
22 deletions
+41
-22
mysql-test/suite/oqgraph/basic.result
mysql-test/suite/oqgraph/basic.result
+19
-0
mysql-test/suite/oqgraph/basic.test
mysql-test/suite/oqgraph/basic.test
+13
-20
storage/oqgraph/ha_oqgraph.cc
storage/oqgraph/ha_oqgraph.cc
+9
-2
No files found.
mysql-test/suite/oqgraph/basic.result
View file @
9459746a
...
...
@@ -77,6 +77,25 @@ latch origid destid weight seq linkid
no_search 1 2 1 3 1
no_search 1 2 1 2 3
no_search 1 2 1 1 2
SELECT * FROM graph WHERE latch='0' and destid=2 and origid=1;
latch origid destid weight seq linkid
0 1 2 1 3 1
0 1 2 1 2 3
0 1 2 1 1 2
SELECT * FROM graph WHERE latch = 'breadth_first';
latch origid destid weight seq linkid
# Expect no result, because of invalid latch
SELECT * FROM graph WHERE latch='bogus';
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch=666;
latch origid destid weight seq linkid
SELECT * FROM graph WHERE latch='bogus' and destid=2 and origid=1;
latch origid destid weight seq linkid
Warnings:
Warning 1210 Incorrect arguments to OQGRAPH latch
# Make sure we dont crash if someone passed in a UTF string
SELECT * FROM graph WHERE latch='Ohms Ω Tennis Ball 〄';
latch origid destid weight seq linkid
# Expect no result, because of autocast and deprecated syntax
SELECT * FROM graph WHERE latch=0 and destid=2 and origid=1;
latch origid destid weight seq linkid
...
...
mysql-test/suite/oqgraph/basic.test
View file @
9459746a
...
...
@@ -63,30 +63,23 @@ SELECT * FROM graph WHERE latch='dijkstras' AND origid=4 AND destid=1;
SELECT
*
FROM
graph
WHERE
latch
=
'1'
AND
origid
=
4
AND
destid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'no_search'
and
destid
=
2
and
origid
=
1
;
SELECT
*
FROM
graph
WHERE
latch
=
'0'
and
destid
=
2
and
origid
=
1
;
#--breadth first with no orig id etc
SELECT
*
FROM
graph
WHERE
latch
=
'breadth_first'
;
--
echo
# Expect no result, because of invalid latch
SELECT
*
FROM
graph
WHERE
latch
=
'bogus'
;
SELECT
*
FROM
graph
WHERE
latch
=
666
;
SELECT
*
FROM
graph
WHERE
latch
=
'bogus'
and
destid
=
2
and
origid
=
1
;
--
echo
# Make sure we dont crash if someone passed in a UTF string
SELECT
*
FROM
graph
WHERE
latch
=
'Ohms Ω Tennis Ball 〄'
;
--
echo
# Expect no result, because of autocast and deprecated syntax
SELECT
*
FROM
graph
WHERE
latch
=
0
and
destid
=
2
and
origid
=
1
;
#-- FIXME SELECT * FROM graph2 WHERE latch='0' and destid=2 and origid=1; -- causes assertion (at least in debug build, havent tested normal)
#-- sql/mysqld(my_print_stacktrace+0x35)[0xdbbc02]
#-- sql/mysqld(handle_fatal_signal+0x355)[0x7dfd05]
#-- /lib/libpthread.so.0(+0xeff0)[0x7f4810addff0]
#-- /lib/libc.so.6(gsignal+0x35)[0x7f480feda1b5]
#-- /lib/libc.so.6(abort+0x180)[0x7f480fedcfc0]
#-- /lib/libc.so.6(__assert_fail+0xf1)[0x7f480fed3301]
#-- sql/mysqld(_ZN7handler8ha_resetEv+0x8b)[0x7eb6a9]
#-- sql/mysqld(_Z18close_thread_tableP3THDPP5TABLE+0x297)[0x5b1207]
#-- sql/mysqld[0x5b09c4]
#-- sql/mysqld(_Z19close_thread_tablesP3THD+0x33f)[0x5b0f5d]
#-- sql/mysqld(_Z21mysql_execute_commandP3THD+0x7fe9)[0x61cc6b]
#-- sql/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x268)[0x61f9ec]
#-- sql/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0xc3e)[0x6129ba]
#-- sql/mysqld(_Z10do_commandP3THD+0x33f)[0x611b35]
#-- sql/mysqld(_Z24do_handle_one_connectionP3THD+0x1f6)[0x721ba9]
#-- sql/mysqld(handle_one_connection+0x33)[0x721651]
#-- /lib/libpthread.so.0(+0x68ca)[0x7f4810ad58ca]
#-- /lib/libc.so.6(clone+0x6d)[0x7f480ff7792d]
--
echo
# Expect no result, because of NULL latch
SELECT
*
FROM
graph
WHERE
latch
=
NULL
and
destid
=
2
and
origid
=
1
;
...
...
storage/oqgraph/ha_oqgraph.cc
View file @
9459746a
...
...
@@ -778,8 +778,8 @@ static int parse_latch_string_to_legacy_int(const String& value, int &latch)
char
*
eptr
;
unsigned
long
int
v
=
strtoul
(
latchValue
.
c_ptr_safe
(),
&
eptr
,
10
);
if
(
!*
eptr
)
{
// we had an unsigned number
.
if
(
v
>
0
&&
v
<
oqgraph
::
NUM_SEARCH_OP
)
{
// we had an unsigned number
; remember 0 is valid too (nosearch))
if
(
v
>
=
0
&&
v
<
oqgraph
::
NUM_SEARCH_OP
)
{
latch
=
v
;
return
true
;
}
...
...
@@ -835,6 +835,13 @@ int ha_oqgraph::index_read_idx(byte * buf, uint index, const byte * key,
// Invalid, so warn & fail
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_WARN
,
ER_WRONG_ARGUMENTS
,
ER
(
ER_WRONG_ARGUMENTS
),
"OQGRAPH latch"
);
table
->
status
=
STATUS_NOT_FOUND
;
if
(
ptrdiff
)
/* fixes debug build assert - should be a tidier way to do this */
{
field
[
0
]
->
move_field_offset
(
-
ptrdiff
);
field
[
1
]
->
move_field_offset
(
-
ptrdiff
);
field
[
2
]
->
move_field_offset
(
-
ptrdiff
);
}
dbug_tmp_restore_column_map
(
table
->
read_set
,
old_map
);
return
error_code
(
oqgraph
::
NO_MORE_DATA
);
}
}
...
...
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