Menu

Exception and 18446744073709551615

Valery
2009-07-02
2012-09-19
  • Valery

    Valery - 2009-07-02

    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.

     
    • Kyle VanderBeek

      Kyle VanderBeek - 2009-07-23

      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.

       
    • Andy Dustman

      Andy Dustman - 2009-07-02

      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.

       
      • Valery

        Valery - 2009-07-17

        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.

         
      • Valery

        Valery - 2009-07-07

        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.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.