I was having an issue with a C# MySqlConnector in a recent project because I was trying to insert into a real time index and the connector was automatically terminating the command it would send with a semicolon (if I added a semicolon the connector wouldn’t bother, but if I didn’t the connector would).
Both Sphinx and Manticore were returning a parsing error with the message:
sphinxql: syntax error, unexpected ‘;’, expecting $end near ‘;’
I found a way to rectify this issue with the Manticore source code by adding a single line into the source file “sphinxql.y”:
After the following section in “sphinxql.y”:
request:
statement { pParser->PushQuery(); }
I simply added the following line which resolved my issues:
| statement ‘;’ { pParser->PushQuery(); }
With this addition Manticore still gives an error when trying to use multiple commands but no longer fails with an unexpected semicolon and doesn’t appear to cause any other issues (that I could find).
The command parser in the connector parses the command, sets a state flag saying either a semicolon needs to be added or not. The command is sent after parsing with the added semicolon that can not be removed.
I tried to use the oracle C# MySql connector with issues even trying to connect to Sphinx (I didn’t try with Manticore), with an error when sphinx sent the string UTF-8 as an integer and MySql connector was trying to parse it as an integer instead of as a string.
It actually took me a couple of days trying to get anything to connect to Sphinx at all, then when I succeeded I could send a SELECT statement to Sphinx/Manticore with the automatically added semicolon, but failed with an INSERT command (which is the reason for this topic).
Do you mean ticket for Manticore or for the Connector?
What I suggested at the start of the topic is a solution that will ensure consistency within Manticore since it already allows a semicolon for several statements at the end, but not for INSERT.
It took me a day of pulling my hair out since the connector was automatically adding a semicolon for both SELECT statements and INSERT commands, but Manticore/Sphinx was rejecting it only for the INSERT command.
I know the solution for the connector would be check if this is the last/only command and remove the semicolon, but modifying manticore was easier for me to allow semicolons at the end and progress with my program.