summaryrefslogtreecommitdiff
path: root/storage/sphinx
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-02-26 15:28:07 +0100
committerSergei Golubchik <sergii@pisem.net>2014-02-26 15:28:07 +0100
commit0dc23679c867629ded5f9534d2ab6e8edf238aa0 (patch)
tree9cf966507fa2ef0fd17932b600d051df5f7bd2e5 /storage/sphinx
parent6efa5efa7dd112b6ac2efdd84235a13cca51c4d4 (diff)
parent0b9a0a3517ca2b75655f3af5c372cf333d3d5fe2 (diff)
downloadmariadb-git-0dc23679c867629ded5f9534d2ab6e8edf238aa0.tar.gz
10.0-base merge
Diffstat (limited to 'storage/sphinx')
-rw-r--r--storage/sphinx/ha_sphinx.cc4
-rw-r--r--storage/sphinx/mysql-test/sphinx/suite.pm1
-rw-r--r--storage/sphinx/mysql-test/sphinx/union-5539.result10
-rw-r--r--storage/sphinx/mysql-test/sphinx/union-5539.test16
4 files changed, 30 insertions, 1 deletions
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index 1efe5bae279..080496ce826 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -3588,11 +3588,13 @@ int sphinx_showfunc_words ( THD * thd, SHOW_VAR * out, char * sBuffer )
int sphinx_showfunc_error ( THD * thd, SHOW_VAR * out, char * )
{
CSphSEStats * pStats = sphinx_get_stats ( thd, out );
+ out->type = SHOW_CHAR;
if ( pStats && pStats->m_bLastError )
{
- out->type = SHOW_CHAR;
out->value = pStats->m_sLastMessage;
}
+ else
+ out->value = (char*)"";
return 0;
}
diff --git a/storage/sphinx/mysql-test/sphinx/suite.pm b/storage/sphinx/mysql-test/sphinx/suite.pm
index e652b38338f..e4c3c1b9f74 100644
--- a/storage/sphinx/mysql-test/sphinx/suite.pm
+++ b/storage/sphinx/mysql-test/sphinx/suite.pm
@@ -60,6 +60,7 @@ sub searchd_start {
my ($sphinx, $test) = @_; # My::Config::Group, My::Test
return unless $exe_sphinx_indexer and $exe_sphinx_searchd;
+ return if $sphinx->{proc}; # Already started
# First we must run the indexer to create the data.
my $sphinx_data_dir= "$::opt_vardir/" . $sphinx->name();
diff --git a/storage/sphinx/mysql-test/sphinx/union-5539.result b/storage/sphinx/mysql-test/sphinx/union-5539.result
new file mode 100644
index 00000000000..414bcce30e9
--- /dev/null
+++ b/storage/sphinx/mysql-test/sphinx/union-5539.result
@@ -0,0 +1,10 @@
+create table ts (id bigint unsigned not null, w int not null, query varchar(255) not null, index(query)) engine=sphinx connection="sphinx://127.0.0.1:PORT/*";
+SELECT a.* FROM (SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500') AS a UNION SELECT b.* FROM (SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500') AS b;
+id w query
+SELECT a.* FROM (SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500') AS a UNION SELECT b.* FROM (SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500') AS b;
+id w query
+1 1 ;mode=extended2;limit=1000000;maxmatches=500
+2 1 ;mode=extended2;limit=1000000;maxmatches=500
+3 1 ;mode=extended2;limit=1000000;maxmatches=500
+4 1 ;mode=extended2;limit=1000000;maxmatches=500
+drop table ts;
diff --git a/storage/sphinx/mysql-test/sphinx/union-5539.test b/storage/sphinx/mysql-test/sphinx/union-5539.test
new file mode 100644
index 00000000000..ec73be1ab3e
--- /dev/null
+++ b/storage/sphinx/mysql-test/sphinx/union-5539.test
@@ -0,0 +1,16 @@
+#
+# MDEV-5539 Empty results in UNION with Sphinx engine
+#
+--replace_result $SPHINXSEARCH_PORT PORT
+eval create table ts (id bigint unsigned not null, w int not null, query varchar(255) not null, index(query)) engine=sphinx connection="sphinx://127.0.0.1:$SPHINXSEARCH_PORT/*";
+let $q1=SELECT * FROM ts si WHERE si.query=';mode=extended2;limit=1000000;maxmatches=500';
+let $q2=SELECT * FROM ts si WHERE si.query='@* 123nothingtofind123;mode=extended2;limit=1000000;maxmatches=500';
+########################
+# BUG BUG BUG !!!
+# Note, the result below is incorrect! It should be updated when
+# MDEV-5539 is fixed upstream!!!
+########################
+eval SELECT a.* FROM ($q1) AS a UNION SELECT b.* FROM ($q2) AS b;
+eval SELECT a.* FROM ($q2) AS a UNION SELECT b.* FROM ($q1) AS b;
+drop table ts;
+