Uploaded image for project: 'Lucee Development'
  1. LDEV-364

queryParam null=true doesn't work for QueryExecute

    Details

    • Sprint:
      August 2017 Sprint

      Description

      Assuming we have a table like this:

      CREATE TABLE null_test (
        nullable_column varchar(20) DEFAULT NULL
      )
      

      Run the following code:

      myVar = "";
      
      QueryExecute("INSERT INTO null_test VALUES (?)", [{value=myVar, sqltype="varchar", null=IsEmpty(myVar)}]);
      
      new Query().setSQL("INSERT INTO null_test(nullable_column) VALUES (?)").addParam(value=myVar, sqltype="varchar", null=IsEmpty(myVar)).execute();
      
      dump(QueryExecute("SELECT COALESCE(nullable_column, '[null]') FROM null_test"));
      

      The first row with QueryExecute is inserted as an empty string(wrong), while the second with Query object is inserted as null(correct).

        Attachments

        1. LDEV-364.cfc
          4 kB
        2. queryexecute.cfm
          1 kB
        3. queryexecute-null-bug.png
          4 kB
        4. screenshot-2.png
          13 kB

          Issue links

            Activity

              People

              • Assignee:
                21solutions Igal Sapir
                Reporter:
                kliakos kliakos
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: