Commit f90dca1a authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-6014 Merge fixed OQGRAPH into 10.0 tree

parents 9c9aa62d 8bc1fa73
......@@ -16,12 +16,12 @@ ENDIF()
INCLUDE_DIRECTORIES(${Judy_INCLUDE_DIR})
IF(MSVC)
# lp:756966 OQGRAPH on Win64 does not compile
IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(BOOST_OK 0)
ELSE()
# # lp:756966 OQGRAPH on Win64 does not compile
# IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
# SET(BOOST_OK 0)
# ELSE()
SET(BOOST_OK 1)
ENDIF()
# ENDIF()
ELSE()
# See if that works. On old gcc it'll fail because of -fno-rtti
CHECK_CXX_SOURCE_COMPILES(
......@@ -38,6 +38,8 @@ IF(BOOST_OK)
ADD_DEFINITIONS(-DHAVE_OQGRAPH)
IF(MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
# Fix problem with judy not finding inttypes.h on Windows:
ADD_DEFINITIONS(-DJU_WIN)
ELSE(MSVC)
# 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")
......
OQGraph storage engine v3
Copyright (C) 2007-2013 Arjen G Lentz & Antony T Curtis for Open Query
Copyright (C) 2007-2014 Arjen G Lentz & Antony T Curtis for Open Query, & Andrew McDonnell
The Open Query GRAPH engine (OQGRAPH) is a computation engine allowing
hierarchies and more complex graph structures to be handled in a
......@@ -12,9 +12,22 @@ v3 implementation by Antony Curtis, Arjen Lentz, Andrew McDonnell
For more information, documentation, support, enhancement engineering,
see http://openquery.com/graph or contact graph@openquery.com
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/
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
# - 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
#
# Judy_FOUND - system has Judy
......@@ -6,17 +20,37 @@
# Judy_LIBRARIES - Link these to use Judy
# Judy_DEFINITIONS - Compiler switches required for using Judy
IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
SET(Judy_FIND_QUIETLY TRUE)
ENDIF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
IF(MSVC)
# For now, assume Judy built according to the above instructions
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_LIBRARY(Judy_LIBRARIES NAMES Judy)
FIND_PATH(Judy_INCLUDE_DIR Judy.h PATHS ${Judy_INCLUDE_DIR_search})
FIND_LIBRARY(Judy_LIBRARIES Judy PATHS ${Judy_LIBRARIES_search})
IF (Judy_INCLUDE_DIR AND Judy_LIBRARIES)
SET(Judy_FOUND TRUE)
SET(Judy_FOUND TRUE)
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)
IF (Judy_FOUND)
......
......@@ -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
// 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
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.dest= dest;
......
......@@ -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;
......
DROP TABLE IF EXISTS graph_base;
DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph2;
Performing OQGraph General test suite for ENGINE=Aria
CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
) ENGINE= Aria ;
CREATE TABLE graph (
latch VARCHAR(32) NULL,
origid BIGINT UNSIGNED NULL,
......@@ -17,6 +18,8 @@ linkid BIGINT UNSIGNED NULL,
KEY (latch, origid, destid) USING HASH,
KEY (latch, destid, origid) USING HASH
) 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,3), (3,1);
INSERT INTO graph_base(from_id, to_id) VALUES (3,4), (4,3);
......
# 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
This diff is collapsed.
# 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
This diff is collapsed.
# 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
......@@ -4,13 +4,15 @@ DROP TABLE IF EXISTS graph;
DROP TABLE IF EXISTS graph2;
--enable_warnings
--echo Performing OQGraph General test suite for ENGINE=$oqgraph_use_table_type
# Create the backing store
CREATE TABLE graph_base (
eval CREATE TABLE graph_base (
from_id INT UNSIGNED NOT NULL,
to_id INT UNSIGNED NOT NULL,
PRIMARY KEY (from_id,to_id),
INDEX (to_id)
) ENGINE=MyISAM;
) ENGINE= $oqgraph_use_table_type ;
CREATE TABLE graph (
......@@ -24,6 +26,9 @@ CREATE TABLE graph (
KEY (latch, destid, origid) USING HASH
) 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
#-- +-->(2)
......
#!/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
# 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
# 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`;
}
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`;
# 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
......@@ -184,6 +184,10 @@ namespace oqgraph3
typedef edge_info key_type;
typedef boost::readable_property_map_tag category;
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;
};
......@@ -436,16 +440,6 @@ namespace boost
const oqgraph3::graph& 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<
oqgraph3::graph,
edge_index_t>::const_type::reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment