Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Using mysqlconnector with Manticore #1356

Answered by bgrainger
carlokok asked this question in Q&A
Discussion options

I'm using mysqlconnector with Manticore which has a mySQL interface, however I see some queries failing with:

[@\uE001MySqlConnector\uE001Sleep;'"](sphinxql: syntax error, unexpected $undefined, expecting FROM or ',' near '@\uE001MySqlConnector\uE001Sleep;'")

Connection string is:
($"Server={config.Hostname};Port={config.Port};Database={config.Database};ConnectionReset=false; Default Command Timeout=6;UseCompression=false;ConnectionIdleTimeout=10;Connection Timeout=5"

is there a way to make it not run those sleep commands?

You must be logged in to vote

A workaround would be avoiding MySqlConnector's built-in query cancellation and reimplementing it with your own timer that executes KILL QUERY nnn on a background thread after six seconds. (You can get the value for the query to kill by reading MySqlConnection.ServerThread before the command is executed.)

Replies: 1 comment 6 replies

Comment options

That command is coming from query cancellation. You have Default Command Timeout=6; in your connection string. Does it need to be so low (resulting in frequent query cancellation)?

FWIW, the current syntax that MySqlConnector uses was chosen in #1115 to be more compatible with Xpand DB and Singlestore.

You must be logged in to vote
6 replies
Comment options

It does not:
SQL Error (1064): sphinxql: syntax error, unexpected @uservar, expecting FROM or ',' near '@dummy'

Fwiw we do this so that it gives up after 6 seconds, if it takes 6 seconds to do a query against manticore I'd rather it give up all together. (If there's a better way to do that I'm all for trying it)

Comment options

The older version of the code used DO SLEEP(0); to clear any pending cancellation: ccca234

I also get an error with Manticore using that syntax: error payload: 1064, 42000, P02: syntax error, unexpected identifier near 'DO SLEEP(0);'

That makes me think that this isn't a recent regression, but that query cancellation never worked with Manticore.

Comment options

Using the latest Docker image, the server identifies itself as 6.2.0 45680f95d@230804 (columnar 2.2.0 dc33868@230804) (secondary 2.2.0 dc33868@230804). This doesn't include the word "Manticore", so auto-detecting the server type might be challenging.

Comment options

A workaround would be avoiding MySqlConnector's built-in query cancellation and reimplementing it with your own timer that executes KILL QUERY nnn on a background thread after six seconds. (You can get the value for the query to kill by reading MySqlConnection.ServerThread before the command is executed.)

Answer selected by carlokok
Comment options

Yeah I'll try that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /