Skip to content

Commit

Permalink
Work around bugs in name resolution in SphinxSE on MySQL 5.5
Browse files Browse the repository at this point in the history
No existant version of SphinxSE is currently capable of resolving
hostnames in CONNECTION= strings on MySQL 5.5.  As such, default to
127.0.0.1 when configuring the SphinxSE table on MySQL 5.5 or above.
See http://sphinxsearch.com/bugs/view.php?id=1815
  • Loading branch information
alexmv committed Dec 27, 2013
1 parent 87fdc3a commit 0b4868f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sbin/rt-setup-fulltext-index.in
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,16 @@ if ( $DB{'type'} eq 'mysql' ) {
default => $DEFAULT{'table'},
silent => !$OPT{'ask'},
);
my $url = $OPT{'url'} || prompt(

my $url = 'sphinx://localhost:3312/rt';
my $version = ($dbh->selectrow_array("show variables like 'version'"))[1];
$url = 'sphinx://127.0.0.1:3312/rt'
if $version and $version =~ /^(\d+\.\d+)/ and $1 >= 5.5;

$url = $OPT{'url'} || prompt(
message => "Enter URL of the sphinx search server; this should be of the form\n"
. "sphinx://<server>:<port>/<index name>",
default => 'sphinx://localhost:3312/rt',
default => $url,
silent => !$OPT{'ask'},
);
my $maxmatches = $OPT{'maxmatches'} || prompt(
Expand Down

0 comments on commit 0b4868f

Please sign in to comment.