MySQL query browser procedure error code -1?

Googling around, there are several reports of the same error, but little information to solve the problem. There's even a bug logged at mysql. Com but it appears to have been abandoned without being resolved There's another StackOverflow question on the same error, but it's also unresolved All it means is that there is no result set from the query.

Looking at the source code, it appears that sometimes an error status of MYX_SQL_ERROR is set when the query has no result set. Perhaps this is not an appropriate consequence? I notice that when I use the mysql command-line client, it yields no error for calling a proc that returns no result set update: I tried to revive that MySQL bug report, and provide a good test case for them.

They changed the bug from "no feedback" to "verified" -- so at least they acknowledge it's a bug in Query Browser: 11 Dec 9:18 Sveta Smirnova Bill thank you for the feedback. Verified as described Although most likely this only be fixed when MySQL Query Browser functionality is part of MySQL workbench I guess the workaround is to ignore the -1 error, or to test your stored procedures in the command-line mysql client, where the error does not occur The comment supposes the issue will disappear as the Query Browser functionality becomes part of MySQL Workbench. This is supposed to happen in MySQL Workbench 5.2 I'll download this beta and give it a try MySQL Workbench 5.2 is in Beta, but I would assume MySQL engineering can't predict when the Beta will become GA.

Those kinds of predictions are hard enough under standard conditions, but there's a lot of extra uncertainty of MySQL's fate due to the unresolved Oracle acquisition update: Okay, I have tried MySQL Workbench 5.2.10 beta. I executed a stored procedure like this: CREATE PROCEDURE FooProc(doquery SMALLINT) BEGIN IF doquery THEN SELECT * FROM Foo; END IF; END When I CALL FooProc(0) the response is no result set, and the status is simply "OK When I CALL FooProc(1) the response is the result of SELECT * FROM Foo as expected However, there's another bug related to calling procedures. Procedures may have multiple result sets, so it's hard to know when to close the statement when you execute a CALL query.

The consequence is that MySQL Workbench 5.2 doesn't close the statement, and if you try to do another query (either CALL or SELECT ) it gives you an error: Commands out of sync; you can't run this command now MySQL doesn't support multiple concurrent open queries. So the last one must be closed before you can start a new one. But it isn't closing the CALL query.

This bug is also logged at the MySQL site The bug about commands out of sync has been resolved. They say it's fixed in MySQL Workbench 5.2.11.

Googling around, there are several reports of the same error, but little information to solve the problem. There's even a bug logged at mysql. Com but it appears to have been abandoned without being resolved.

There's another StackOverflow question on the same error, but it's also unresolved. All it means is that there is no result set from the query. Looking at the source code, it appears that sometimes an error status of MYX_SQL_ERROR is set when the query has no result set.

Perhaps this is not an appropriate consequence? I notice that when I use the mysql command-line client, it yields no error for calling a proc that returns no result set. Update: I tried to revive that MySQL bug report, and provide a good test case for them.

They changed the bug from "no feedback" to "verified" -- so at least they acknowledge it's a bug in Query Browser: 11 Dec 9:18 Sveta Smirnova Bill, thank you for the feedback. Verified as described. Although most likely this only be fixed when MySQL Query Browser functionality is part of MySQL workbench.

I guess the workaround is to ignore the -1 error, or to test your stored procedures in the command-line mysql client, where the error does not occur. The comment supposes the issue will disappear as the Query Browser functionality becomes part of MySQL Workbench. This is supposed to happen in MySQL Workbench 5.2.I'll download this beta and give it a try.

MySQL Workbench 5.2 is in Beta, but I would assume MySQL engineering can't predict when the Beta will become GA. Those kinds of predictions are hard enough under standard conditions, but there's a lot of extra uncertainty of MySQL's fate due to the unresolved Oracle acquisition. Update: Okay, I have tried MySQL Workbench 5.2.10 beta.

I executed a stored procedure like this: CREATE PROCEDURE FooProc(doquery SMALLINT) BEGIN IF doquery THEN SELECT * FROM Foo; END IF; END When I CALL FooProc(0) the response is no result set, and the status is simply "OK". When I CALL FooProc(1) the response is the result of SELECT * FROM Foo as expected. However, there's another bug related to calling procedures.

Procedures may have multiple result sets, so it's hard to know when to close the statement when you execute a CALL query. The consequence is that MySQL Workbench 5.2 doesn't close the statement, and if you try to do another query (either CALL or SELECT) it gives you an error: Commands out of sync; you can't run this command now. MySQL doesn't support multiple concurrent open queries.

So the last one must be closed before you can start a new one. But it isn't closing the CALL query. This bug is also logged at the MySQL site.

The bug about commands out of sync has been resolved. They say it's fixed in MySQL Workbench 5.2.11.

Yeah I found the same bug report on mysql. Com, and a few unresolved threads dispersed here and there on the issue. So would you say that this is a problem with the query browser client?

– 2Ti Dec 13 '09 at 12:38 Yes; see my update above. – Bill Karwin Dec 13 '09 at 18:32 reg. "Commands out of sync": beta is beta – noonex Dec 15 '09 at 11:45.

Query Browser is not for running scripts, just single query. I tried your code by moving cursor into each query (except DELIMITER) and pressing Ctrl+Enter. It created that stored procedure without problem.(just refresh schema on the left).

If you wish creating procedure, use menu "Script"->"Create stored procedure/function". But better forget about QueryBrowser it is not supported at all (and actunally not useful). If you have decent hardware and plenty resources, try Workbench 5.2 otherwise use SQLyog.

Ok, tried workbench 5.2 beta. That seems to be fine, so then the problem is mysql query browser and jHeidi. Thanks for this.

– 2Ti Dec 13 '09 at 12:59.

Try putting BEGIN and END blocks around the multiple statements in the IF block as such: IF quota > 0 THEN BEGIN OPEN c_artist; REPEAT FETCH c_artist INTO artist_id,releases; IF NOT done THEN IF releases >= quota THEN UPDATE CD SET CD. Rating='favourite' WHERE CD. Is_fronted_by = artist_id; END IF; END IF; UNTIL done END REPEAT; CLOSE c_artist; END; ELSE SELECT CONCAT('\'quota\' must be greater than 0.',' Got (',quota,')'); END IF.

That compiles but still comes up with the same error -1. – 2Ti Dec 4 '09 at 16:13.

First ensure that you have established your mysql connection through PHP. Get the full details on php mysql connection you can read the article here. If you are using PDO then start with PDO connection string here.

Let us start with the function required to execute one query in PHP. Once you have connection established then we can execute sql command by using PHP function mysql_query(). Here is the syntax of the function.

Let us first write the query and store in a variable. Parameter to the function like below. We will use php if command to check the status of the query.

So from the above line we can know that the query has worked or failed. Not come to know what the error is if the query has failed. Returned by MySQL database after executing the query.

The error message. You can read more on mysql error here. Complete code is available below.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions