cursor.execute for stored function returns 18446744073709551615L. From previous thread, I found out that this is error (-1) . This means that stored function failed, but I do not know the reason.
Can anybody help?
1. Is it possible to get error description?
2. Can mysqldb raises the exception in this case?
Thanks,
Valery.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually, I think this is a situation that we should handle and likely throw a ProgrammingError for. From http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html : "-1 indicates that the query returned an error or that, for a SELECT query, mysql_affected_rows() was called prior to calling mysql_store_result()."
sentromed: can you provide me with an example script that makes this happen? It'd be really helpful as I'm not certain how to make it occur. If possible, attach it to this bug:
I'm trying to figure out if we should return -1 or do a more pythonic ProgrammingError, but I'd like to see a test case as it may actually indicate an invalid code path on MySQLdb's part.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is not an error. You cannot depend on the return value of cursor.execute to mean anything. Sometimes it's the number of rows affected, but this cannot always be determined, in which case you may get -1 or 18446744073709551615L.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello. Sorry did not get the answer and try to ask again.
I have stored procedure. Sometimes it failes. When I run it inside Mysql Query Browser with invalid values, I got the error. I see it at to bottom of the window.
When I call the same procedure/function using mysqldb (cursor.execute), I got that big number. Most resonable to get exception.
In the same time, if I do cursor.execute for statement that generate that error, I got exception (that same that is in Browser).
Please clarify. it is a bug, known issue, feature, as designed?
Thanks,
Valery.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably I did not explain my problem correctly.
I create stored function. Sometimes it fails. When I select the function in MySQL Query Browser, I got the error. But when I do cursor.execute I get that large number. That is not that I expected. I would like to get exception with the error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
cursor.execute for stored function returns 18446744073709551615L. From previous thread, I found out that this is error (-1) . This means that stored function failed, but I do not know the reason.
Can anybody help?
1. Is it possible to get error description?
2. Can mysqldb raises the exception in this case?
Thanks,
Valery.
Actually, I think this is a situation that we should handle and likely throw a ProgrammingError for. From http://dev.mysql.com/doc/refman/5.0/en/mysql-affected-rows.html : "-1 indicates that the query returned an error or that, for a SELECT query, mysql_affected_rows() was called prior to calling mysql_store_result()."
sentromed: can you provide me with an example script that makes this happen? It'd be really helpful as I'm not certain how to make it occur. If possible, attach it to this bug:
https://sourceforge.net/tracker/?func=detail&aid=2790723&group_id=22307&atid=374932
I'm trying to figure out if we should return -1 or do a more pythonic ProgrammingError, but I'd like to see a test case as it may actually indicate an invalid code path on MySQLdb's part.
Thanks.
This is not an error. You cannot depend on the return value of cursor.execute to mean anything. Sometimes it's the number of rows affected, but this cannot always be determined, in which case you may get -1 or 18446744073709551615L.
Hello. Sorry did not get the answer and try to ask again.
I have stored procedure. Sometimes it failes. When I run it inside Mysql Query Browser with invalid values, I got the error. I see it at to bottom of the window.
When I call the same procedure/function using mysqldb (cursor.execute), I got that big number. Most resonable to get exception.
In the same time, if I do cursor.execute for statement that generate that error, I got exception (that same that is in Browser).
Please clarify. it is a bug, known issue, feature, as designed?
Thanks,
Valery.
Probably I did not explain my problem correctly.
I create stored function. Sometimes it fails. When I select the function in MySQL Query Browser, I got the error. But when I do cursor.execute I get that large number. That is not that I expected. I would like to get exception with the error.