Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-764

Calling stored procedure with INOUT parameter fails if the value is null

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.4
    • None
    • Core
    • None
    • linux kernel 2.6.31, MySQL 5.0.91, MySQL 5.1.44

    Description

      When I'm calling a MySQL stored procedure with INOUT parameter and the parameter value is NULL an exception is thrown: java.sql.SQLException: Incorrect integer value: 'null' for column 'p_value' at row 1.
      Here's my MySQL server log fragment:
      42 Query SET @com_mysql_jdbc_outparam_p_value='null'
      42 Query call procedure_with_inout_parameters( @com_mysql_jdbc_outparam_p_id, @com_mysql_jdbc_outparam_p_value )
      So it seems like value 'null' (quoted!) is assigned to the variable passed to the procedure (instead of null). The jdbcType of the parameter is explicitly set in the inline parameter map of the call.

      I'm not really sure if it's a IBatis or MySQL jdbc issue - I will attach a test case exposing this problem.

      Attachments

        1. inout_test.tar.gz
          4 kB
          Olaf Tomczak

        Activity

          People

            Unassigned Unassigned
            olafos Olaf Tomczak
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: