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
f90dca1a
Commit
f90dca1a
authored
May 05, 2014
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
MDEV-6014 Merge fixed OQGRAPH into 10.0 tree
parents
9c9aa62d
8bc1fa73
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
3408 additions
and
32 deletions
+3408
-32
storage/oqgraph/CMakeLists.txt
storage/oqgraph/CMakeLists.txt
+7
-5
storage/oqgraph/README
storage/oqgraph/README
+17
-4
storage/oqgraph/cmake/FindJudy.cmake
storage/oqgraph/cmake/FindJudy.cmake
+42
-8
storage/oqgraph/graphcore.cc
storage/oqgraph/graphcore.cc
+6
-1
storage/oqgraph/ha_oqgraph.cc
storage/oqgraph/ha_oqgraph.cc
+3
-1
storage/oqgraph/mysql-test/oqgraph/general-Aria.result
storage/oqgraph/mysql-test/oqgraph/general-Aria.result
+4
-1
storage/oqgraph/mysql-test/oqgraph/general-Aria.test
storage/oqgraph/mysql-test/oqgraph/general-Aria.test
+3
-0
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
+1441
-0
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.test
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.test
+3
-0
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
+1441
-0
storage/oqgraph/mysql-test/oqgraph/general-innodb.test
storage/oqgraph/mysql-test/oqgraph/general-innodb.test
+4
-0
storage/oqgraph/mysql-test/oqgraph/general.inc
storage/oqgraph/mysql-test/oqgraph/general.inc
+7
-2
storage/oqgraph/mysql-test/oqgraph/generate_backing_table_tests_suite.sh
.../mysql-test/oqgraph/generate_backing_table_tests_suite.sh
+52
-0
storage/oqgraph/mysql-test/oqgraph/maintainer-general-record.sh
...e/oqgraph/mysql-test/oqgraph/maintainer-general-record.sh
+5
-0
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.result
...age/oqgraph/mysql-test/oqgraph/regression_mdev5996.result
+283
-0
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
+33
-0
storage/oqgraph/oqgraph_shim.h
storage/oqgraph/oqgraph_shim.h
+4
-10
No files found.
storage/oqgraph/CMakeLists.txt
View file @
f90dca1a
...
@@ -16,12 +16,12 @@ ENDIF()
...
@@ -16,12 +16,12 @@ ENDIF()
INCLUDE_DIRECTORIES
(
${
Judy_INCLUDE_DIR
}
)
INCLUDE_DIRECTORIES
(
${
Judy_INCLUDE_DIR
}
)
IF
(
MSVC
)
IF
(
MSVC
)
# lp:756966 OQGRAPH on Win64 does not compile
#
# lp:756966 OQGRAPH on Win64 does not compile
IF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
#
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET
(
BOOST_OK 0
)
#
SET(BOOST_OK 0)
ELSE
()
#
ELSE()
SET
(
BOOST_OK 1
)
SET
(
BOOST_OK 1
)
ENDIF
()
#
ENDIF()
ELSE
()
ELSE
()
# See if that works. On old gcc it'll fail because of -fno-rtti
# See if that works. On old gcc it'll fail because of -fno-rtti
CHECK_CXX_SOURCE_COMPILES
(
CHECK_CXX_SOURCE_COMPILES
(
...
@@ -38,6 +38,8 @@ IF(BOOST_OK)
...
@@ -38,6 +38,8 @@ IF(BOOST_OK)
ADD_DEFINITIONS
(
-DHAVE_OQGRAPH
)
ADD_DEFINITIONS
(
-DHAVE_OQGRAPH
)
IF
(
MSVC
)
IF
(
MSVC
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/EHsc"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/EHsc"
)
# Fix problem with judy not finding inttypes.h on Windows:
ADD_DEFINITIONS
(
-DJU_WIN
)
ELSE
(
MSVC
)
ELSE
(
MSVC
)
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
# Fix lp bug 1221555 with -fpermissive, so that errors in gcc 4.7 become warnings for the time being
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -fno-strict-aliasing -fpermissive"
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wno-deprecated -fno-strict-aliasing -fpermissive"
)
...
...
storage/oqgraph/README
View file @
f90dca1a
OQGraph storage engine v3
OQGraph storage engine v3
Copyright (C) 2007-201
3 Arjen G Lentz & Antony T Curtis for Open Query
Copyright (C) 2007-201
4 Arjen G Lentz & Antony T Curtis for Open Query, & Andrew McDonnell
The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing
The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing
hierarchies and more complex graph structures to be handled in a
hierarchies and more complex graph structures to be handled in a
...
@@ -12,9 +12,22 @@ v3 implementation by Antony Curtis, Arjen Lentz, Andrew McDonnell
...
@@ -12,9 +12,22 @@ v3 implementation by Antony Curtis, Arjen Lentz, Andrew McDonnell
For more information, documentation, support, enhancement engineering,
For more information, documentation, support, enhancement engineering,
see http://openquery.com/graph or contact graph@openquery.com
see http://openquery.com/graph or contact graph@openquery.com
INSTALLATION
INSTALLATION
OQGraph requires at least version 1.40.0 of the Boost library. To
OQGraph requires at least version 1.40.0 of the Boost
Graph
library. To
obtain a copy of the Boost library, see http://www.boost.org/
obtain a copy of the Boost library, see http://www.boost.org/
This can be obtained in Debian Wheezy by `apt-get install libboost-graph-dev`
OQGraph requires libjudy - http://judy.sourceforge.net/
This can be obtained in Debian Wheezy by `apt-get install libjudy-dev`
BUILD (example)
cd path/to/maria/source
mkdir build # use symlink to scratch
cd build
CONFIGURE="-DWITH_EXTRA_CHARSETS=complex -DWITH_PLUGIN_ARIA=1 -DWITH_READLINE=1 -DWITH_SSL=bundled -DWITH_MAX=1 -DWITH_EMBEDDED_SERVER=1"
cmake .. $CONFIGURE
make -j5
mysql-test-run --suite oqgraph
storage/oqgraph/cmake/FindJudy.cmake
View file @
f90dca1a
# - Try to find Judy
# - Try to find Judy.
#
# Additionally, on Windows, this module reads hints about search locations from variables:
# JUDY_ROOT - Preferred installation prefix
#
# To build Judy on Windows: (Tested with judy-1.0.5)
#
# * Download the sources tarball from http://sourceforge.net/projects/judy/
# * Extract the source
# * Win32: open the Visual Studio C++ Express 2010 command prompt and navigate to the src/ directory.
# Then execute: build.bat
# * Win64: open the Windows SDK 7.1 Command Prompt and navigate to the src/ directory
# Then execute: build.bat
# * Run the mariadb build with JUDY_ROOT=path\to\judy
#
# Once done this will define
# Once done this will define
#
#
# Judy_FOUND - system has Judy
# Judy_FOUND - system has Judy
...
@@ -6,17 +20,37 @@
...
@@ -6,17 +20,37 @@
# Judy_LIBRARIES - Link these to use Judy
# Judy_LIBRARIES - Link these to use Judy
# Judy_DEFINITIONS - Compiler switches required for using Judy
# Judy_DEFINITIONS - Compiler switches required for using Judy
IF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
IF
(
MSVC
)
SET
(
Judy_FIND_QUIETLY TRUE
)
# For now, assume Judy built according to the above instructions
ENDIF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
if
(
NOT
"$ENV{JUDY_ROOT}"
STREQUAL
""
)
# Avoid passing backslashes to _Boost_FIND_LIBRARY due to macro re-parsing.
string
(
REPLACE
"
\\
"
"/"
Judy_INCLUDE_DIR_search $ENV{JUDY_ROOT}/src
)
string
(
REPLACE
"
\\
"
"/"
Judy_LIBRARIES_search $ENV{JUDY_ROOT}/src
)
endif
()
ELSE
(
MSVC
)
IF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
SET
(
Judy_FIND_QUIETLY TRUE
)
ENDIF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
ENDIF
(
MSVC
)
FIND_PATH
(
Judy_INCLUDE_DIR Judy.h
)
FIND_PATH
(
Judy_INCLUDE_DIR Judy.h
PATHS
${
Judy_INCLUDE_DIR_search
}
)
FIND_LIBRARY
(
Judy_LIBRARIES
NAMES Judy
)
FIND_LIBRARY
(
Judy_LIBRARIES
Judy PATHS
${
Judy_LIBRARIES_search
}
)
IF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
IF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
SET
(
Judy_FOUND TRUE
)
SET
(
Judy_FOUND TRUE
)
ELSE
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
ELSE
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
SET
(
Judy_FOUND FALSE
)
SET
(
Judy_FOUND FALSE
)
if
(
MSVC
)
MESSAGE
(
STATUS
"How to build Judy on Windows:"
)
MESSAGE
(
STATUS
"1. Download the source tarball from http://sourceforge.net/projects/judy/"
)
IF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
MESSAGE
(
STATUS
"2. Extract the source, open the Visual Studio command prompt and navigate to the src/ directory."
)
ELSE
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
MESSAGE
(
STATUS
"2. Extract the source, open the Windows SDK 7.1 Command Prompt and navigate to the src/ directory."
)
ENDIF
(
CMAKE_SIZEOF_VOID_P EQUAL 8
)
MESSAGE
(
STATUS
"3. Execute the command: 'build'"
)
MESSAGE
(
STATUS
"4. Rerun this cmake with the environment variable: 'set JUDY_ROOT=x:
\\
path
\\
to
\\
judy'"
)
endif
(
MSVC
)
ENDIF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
ENDIF
(
Judy_INCLUDE_DIR AND Judy_LIBRARIES
)
IF
(
Judy_FOUND
)
IF
(
Judy_FOUND
)
...
...
storage/oqgraph/graphcore.cc
View file @
f90dca1a
...
@@ -1122,7 +1122,12 @@ int edges_cursor::fetch_row(const row &row_info, row &result,
...
@@ -1122,7 +1122,12 @@ int edges_cursor::fetch_row(const row &row_info, row &result,
// but origid and destid can be -1 indicating no such record, NULL? but oqgraph3::vertex_id
// but origid and destid can be -1 indicating no such record, NULL? but oqgraph3::vertex_id
// seems to resolve to VertexID (unsigned) in row
// seems to resolve to VertexID (unsigned) in row
// in any case we should check for errors (-1) in origid... because all edges have at least one vertex by definition
// in any case we should check for errors (-1) in origid... because all edges have at least one vertex by definition
assert
(
!
((
size_t
)
orig
==
(
size_t
)
-
1
&&
(
size_t
)
dest
==
(
size_t
)
-
1
));
// indicates we havent handle a HA_ERR_RECORD_DELETED somewhere
if
(
orig
==
(
oqgraph3
::
vertex_id
)
-
1
&&
dest
==
(
oqgraph3
::
vertex_id
)
-
1
)
{
// Select * from graph; -- when backing store is empty (bug MDEV-5891)
return
oqgraph
::
NO_MORE_DATA
;
}
// assert( ! ((size_t)orig == (size_t)-1 && (size_t)dest == (size_t)-1));
// indicates we havent handle a HA_ERR_RECORD_DELETED somewhere
result
.
orig
=
orig
;
result
.
orig
=
orig
;
result
.
dest
=
dest
;
result
.
dest
=
dest
;
...
...
storage/oqgraph/ha_oqgraph.cc
View file @
f90dca1a
...
@@ -557,9 +557,11 @@ int ha_oqgraph::open(const char *name, int mode, uint test_if_locked)
...
@@ -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
tlen
=
strlen
(
options
->
table_name
);
size_t
plen
=
(
int
)(
p
-
name
)
+
tlen
+
1
;
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
);
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
->
normalized_path
.
str
=
share
->
path
.
str
;
share
->
path
.
length
=
share
->
normalized_path
.
length
=
plen
;
share
->
path
.
length
=
share
->
normalized_path
.
length
=
plen
;
...
...
storage/oqgraph/mysql-test/oqgraph/
basic
.result
→
storage/oqgraph/mysql-test/oqgraph/
general-Aria
.result
View file @
f90dca1a
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph2;
DROP TABLE IF EXISTS graph2;
Performing OQGraph General test suite for ENGINE=Aria
CREATE TABLE graph_base (
CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
PRIMARY KEY (from_id,to_id),
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
INDEX (to_id)
) ENGINE=
MyISAM
;
) ENGINE=
Aria
;
CREATE TABLE graph (
CREATE TABLE graph (
latch VARCHAR(32) NULL,
latch VARCHAR(32) NULL,
origid BIGINT UNSIGNED NULL,
origid BIGINT UNSIGNED NULL,
...
@@ -17,6 +18,8 @@ linkid BIGINT UNSIGNED NULL,
...
@@ -17,6 +18,8 @@ linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
KEY (latch, destid, origid) USING HASH
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
) ENGINE=OQGRAPH DATA_TABLE='graph_base' ORIGID='from_id', DESTID='to_id';
select * from graph;
latch origid destid weight seq linkid
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,2), (2,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (1,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
...
...
storage/oqgraph/mysql-test/oqgraph/general-Aria.test
0 → 100644
View file @
f90dca1a
# This is a maintainer generated file. Generated at Wednesday 5 February 22:26:12 CST 2014.
--
let
$oqgraph_use_table_type
=
Aria
--
source
general
.
inc
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.result
0 → 100644
View file @
f90dca1a
This diff is collapsed.
Click to expand it.
storage/oqgraph/mysql-test/oqgraph/general-MyISAM.test
0 → 100644
View file @
f90dca1a
# This is a maintainer generated file. Generated at Wednesday 5 February 22:26:12 CST 2014.
--
let
$oqgraph_use_table_type
=
MyISAM
--
source
general
.
inc
storage/oqgraph/mysql-test/oqgraph/general-innodb.result
0 → 100644
View file @
f90dca1a
This diff is collapsed.
Click to expand it.
storage/oqgraph/mysql-test/oqgraph/general-innodb.test
0 → 100644
View file @
f90dca1a
# This is a maintainer generated file. Generated at Wednesday 5 February 22:26:12 CST 2014.
--
source
include
/
have_innodb
.
inc
--
let
$oqgraph_use_table_type
=
innodb
--
source
general
.
inc
storage/oqgraph/mysql-test/oqgraph/
basic.test
→
storage/oqgraph/mysql-test/oqgraph/
general.inc
View file @
f90dca1a
...
@@ -4,13 +4,15 @@ DROP TABLE IF EXISTS graph;
...
@@ -4,13 +4,15 @@ DROP TABLE IF EXISTS graph;
DROP
TABLE
IF
EXISTS
graph2
;
DROP
TABLE
IF
EXISTS
graph2
;
--
enable_warnings
--
enable_warnings
--
echo
Performing
OQGraph
General
test
suite
for
ENGINE
=
$oqgraph_use_table_type
# Create the backing store
# Create the backing store
CREATE
TABLE
graph_base
(
eval
CREATE
TABLE
graph_base
(
from_id
INT
UNSIGNED
NOT
NULL
,
from_id
INT
UNSIGNED
NOT
NULL
,
to_id
INT
UNSIGNED
NOT
NULL
,
to_id
INT
UNSIGNED
NOT
NULL
,
PRIMARY
KEY
(
from_id
,
to_id
),
PRIMARY
KEY
(
from_id
,
to_id
),
INDEX
(
to_id
)
INDEX
(
to_id
)
)
ENGINE
=
MyISAM
;
)
ENGINE
=
$oqgraph_use_table_type
;
CREATE
TABLE
graph
(
CREATE
TABLE
graph
(
...
@@ -24,6 +26,9 @@ CREATE TABLE graph (
...
@@ -24,6 +26,9 @@ CREATE TABLE graph (
KEY
(
latch
,
destid
,
origid
)
USING
HASH
KEY
(
latch
,
destid
,
origid
)
USING
HASH
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
)
ENGINE
=
OQGRAPH
DATA_TABLE
=
'graph_base'
ORIGID
=
'from_id'
,
DESTID
=
'to_id'
;
# Regression for MDEV-5891
select
*
from
graph
;
#--
#--
#-- ASCII art graph of this test data
#-- ASCII art graph of this test data
#-- +-->(2)
#-- +-->(2)
...
...
storage/oqgraph/mysql-test/oqgraph/generate_backing_table_tests_suite.sh
0 → 100755
View file @
f90dca1a
#!/bin/bash
# This is a template fgenerator or repeating an identical suite of tests for each backing table storage engine
# It generates a set of .test files for the following, for example:
# general-myisam.test
# general-memory.test
# general-innodb.test
# (etc)
#
# We generate these files, because as a general rule the coverage should be identical per backing table engine
# but we might want to pick out and re-reun for an individual backing table engine
# otherwise we could use an MTR loop instead.
# This is intended to be used by a maintainer; i.e. the resulting .test files are still committed to git.
# Note on known storage engines:
# See https://mariadb.com/kb/en/information-schema-engines-table/ for a full list
# CSV - doesn't work with OQGraph, attempting to create backing table gives 'failed: 1069: Too many keys specified; max 0 keys allowed'
# BLACKHOLE - makes no sense... but we should make sure it doesnt crash
# FEDERATED, ARCHIVE - consider later
ENGINES
=
"MyISAM MEMORY Aria"
for
ENGINE
in
$ENGINES
;
do
cat
>
general-
$ENGINE
.test
<<
EOF
# This is a maintainer generated file. Generated at `date`.
--let
\$
oqgraph_use_table_type=
$ENGINE
--source general.inc
EOF
done
# These engines need an extra check to see if thy are compiled
# Note, including innodb will also test xtradb
ENGINES2
=
"innodb"
for
ENGINE
in
$ENGINES2
;
do
cat
>
general-
$ENGINE
.test
<<
EOF
# This is a maintainer generated file. Generated at `date`.
-- source include/have_
$ENGINE
.inc
--let
\$
oqgraph_use_table_type=
$ENGINE
--source general.inc
EOF
done
# Generate a script to rerun the test suite as well
# Intended to be run from build as ../storage/oqgraph/mysql-test/oqgraph/maintainer-general-record.sh
MGFILE
=
maintainer-general-record.sh
echo
'# This is a maintainer generated file. Generated at '
`
date
`
'.'
>
$MGFILE
for
ENGINE
in
$ENGINES
$ENGINES2
;
do
echo
mysql-test/mysql-test-run
--record
oqgraph.general-
$ENGINE
>>
$MGFILE
done
storage/oqgraph/mysql-test/oqgraph/maintainer-general-record.sh
0 → 100755
View file @
f90dca1a
# This is a maintainer generated file. Generated at Wednesday 5 February 22:26:12 CST 2014.
mysql-test/mysql-test-run
--record
oqgraph.general-MyISAM
mysql-test/mysql-test-run
--record
oqgraph.general-MEMORY
mysql-test/mysql-test-run
--record
oqgraph.general-Aria
mysql-test/mysql-test-run
--record
oqgraph.general-innodb
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.inc
0 → 100644
View file @
f90dca1a
# 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.result
0 → 100644
View file @
f90dca1a
Performing OQGraph regression test mdev5996 - using db=``, table=`999999999`
use test;
drop table if exists `999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `999999999` (
`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;
insert into `999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `999999999`;
drop table if exists vvvvvvv_hhhhhhh;
Performing OQGraph regression test mdev5996 - using db=`1`, table=`999999999`
use test;
drop database if exists `1` ;
create database `1` ;
use `1` ;
drop table if exists `999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `999999999` (
`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;
insert into `999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `999999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1`;
Performing OQGraph regression test mdev5996 - using db=`1112222233_4444444`, table=`999999999`
use test;
drop database if exists `1112222233_4444444` ;
create database `1112222233_4444444` ;
use `1112222233_4444444` ;
drop table if exists `999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `999999999` (
`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;
insert into `999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `999999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1112222233_4444444`;
Performing OQGraph regression test mdev5996 - using db=`1112222233_44444444`, table=`999999999`
use test;
drop database if exists `1112222233_44444444` ;
create database `1112222233_44444444` ;
use `1112222233_44444444` ;
drop table if exists `999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `999999999` (
`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;
insert into `999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `999999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1112222233_44444444`;
Performing OQGraph regression test mdev5996 - using db=`1112222233_444444444`, table=`999999999`
use test;
drop database if exists `1112222233_444444444` ;
create database `1112222233_444444444` ;
use `1112222233_444444444` ;
drop table if exists `999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `999999999` (
`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;
insert into `999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `999999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1112222233_444444444`;
Performing OQGraph regression test mdev5996 - using db=`1112222233_444444444`, table=`99999999`
use test;
drop database if exists `1112222233_444444444` ;
create database `1112222233_444444444` ;
use `1112222233_444444444` ;
drop table if exists `99999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `99999999` (
`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;
insert into `99999999` values ( 'x', 'y', 'z', 0, 0);
select * from `99999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='99999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `99999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1112222233_444444444`;
Performing OQGraph regression test mdev5996 - using db=`1112222233_444444444`, table=`9999999999`
use test;
drop database if exists `1112222233_444444444` ;
create database `1112222233_444444444` ;
use `1112222233_444444444` ;
drop table if exists `9999999999` ;
drop table if exists vvvvvvv_hhhhhhh;
CREATE TABLE `9999999999` (
`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;
insert into `9999999999` values ( 'x', 'y', 'z', 0, 0);
select * from `9999999999`;
version updateJSON prevVersion nodeID prevNodeID
x y z 0 0
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='9999999999'
origid='prevNodeID'
destid='nodeID';
select * from vvvvvvv_hhhhhhh;
latch origid destid weight seq linkid
NULL 0 0 1 NULL NULL
drop table if exists `9999999999`;
drop table if exists vvvvvvv_hhhhhhh;
drop database if exists `1112222233_444444444`;
storage/oqgraph/mysql-test/oqgraph/regression_mdev5996.test
0 → 100644
View file @
f90dca1a
# 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
storage/oqgraph/oqgraph_shim.h
View file @
f90dca1a
...
@@ -184,6 +184,10 @@ namespace oqgraph3
...
@@ -184,6 +184,10 @@ namespace oqgraph3
typedef
edge_info
key_type
;
typedef
edge_info
key_type
;
typedef
boost
::
readable_property_map_tag
category
;
typedef
boost
::
readable_property_map_tag
category
;
edge_weight_property_map
(
const
graph
&
g
)
:
_g
(
g
)
{
}
edge_weight_property_map
(
const
graph
&
g
)
:
_g
(
g
)
{
}
friend
inline
reference
get
(
const
edge_weight_property_map
&
p
,
const
key_type
&
key
)
{
return
key
.
weight
();
}
const
graph
&
_g
;
const
graph
&
_g
;
};
};
...
@@ -436,16 +440,6 @@ namespace boost
...
@@ -436,16 +440,6 @@ namespace boost
const
oqgraph3
::
graph
&
g
)
const
oqgraph3
::
graph
&
g
)
{
return
property_map
<
oqgraph3
::
graph
,
edge_weight_t
>::
const_type
(
g
);
}
{
return
property_map
<
oqgraph3
::
graph
,
edge_weight_t
>::
const_type
(
g
);
}
inline
property_map
<
oqgraph3
::
graph
,
edge_weight_t
>::
const_type
::
reference
get
(
const
property_map
<
oqgraph3
::
graph
,
edge_weight_t
>::
const_type
&
p
,
const
property_map
<
oqgraph3
::
graph
,
edge_weight_t
>::
const_type
::
key_type
&
key
)
{
return
key
.
weight
();
}
inline
property_map
<
inline
property_map
<
oqgraph3
::
graph
,
oqgraph3
::
graph
,
edge_index_t
>::
const_type
::
reference
edge_index_t
>::
const_type
::
reference
...
...
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