diff options
author | andrew <andrew@atlantis4.andrewmcdonnell.net> | 2014-04-02 23:02:32 +1030 |
---|---|---|
committer | andrew <andrew@atlantis4.andrewmcdonnell.net> | 2014-04-02 23:02:32 +1030 |
commit | a4a78e3c334a4e69540fb9747f18521db955e672 (patch) | |
tree | 24657c607475e989cfc54e38010b3297c521f150 /storage/oqgraph | |
parent | f77539092d17e645ba54ca89b8e28a99506bca6a (diff) | |
download | mariadb-git-a4a78e3c334a4e69540fb9747f18521db955e672.tar.gz |
Fix for MDEV-5891 - ensure select on empty backing table works.
Diffstat (limited to 'storage/oqgraph')
-rw-r--r-- | storage/oqgraph/graphcore.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/storage/oqgraph/graphcore.cc b/storage/oqgraph/graphcore.cc index 96be1b450f3..de575c9da65 100644 --- a/storage/oqgraph/graphcore.cc +++ b/storage/oqgraph/graphcore.cc @@ -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; |