List:Internals« Previous MessageNext Message »
From:Mark Callaghan Date:December 12 2006 3:07am
Subject:Request for guidelines on return values from handler.h methods
View as plain text  
Are there guidelines on how methods in handler.h should indicate errors?
handler.h in 5.1 is a little better about this than 4.0 because there are
default implementation for many of the methods that distinguish between
those that use HA_ADMIN* values and those that use HA_ERR* values. But the
rules are frequently broken and difficult to infer from the various handler
implementations. ha_innodb.cc usually returns and HA_ERR* value but
occasionally returns -1 or +1. ha_berkeley.cc is similar.

So, my questions are:
1) excluding the admin methods that return HA_ADMIN, what should be returned
on error (always an HA_ERR* value, -1, +1)?
2) should my_errno always be set before returning an error?
3) can a generic error tag be added to HA_ERR* so that neither -1 nor +1 are
used?

-- 
Mark Callaghan
mcallaghan@stripped

Thread
Request for guidelines on return values from handler.h methodsMark Callaghan12 Dec
  • Re: Request for guidelines on return values from handler.h methodsSergei Golubchik12 Dec
    • Re: Request for guidelines on return values from handler.h methodsMark Callaghan12 Dec
      • Re: Request for guidelines on return values from handler.h methodsSergei Golubchik20 Dec
        • Re: Request for guidelines on return values from handler.h methodsSergei Golubchik30 Jan