HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 656 forks source link

Issue 514 - Setting an spod object attribute to null in php - haxe #514

Closed issuesbot closed 11 years ago

issuesbot commented 11 years ago

[Google Issue #514 : https://code.google.com/p/haxe/issues/detail?id=514] by xylo...@gmail.com, at 23/09/2011, 20:36:09 What steps will reproduce the problem?

  1. Use latest HaXe svn version with SPOD macros.
  2. Target PHP.
  3. Setup a MySQL/InnoDB database.
  4. Attempt to set an optional field of an spod object to null.
  5. Update the object in the db.

What is the expected output? What do you see instead?

I expect for the code to update the db. Instead I get:

"Error while executing UPDATE spod SET optfield = WHERE id = 1 ..."

Please complete the following class with minimal code reproducing the problem :

class Test {
    static function main() {
        //... setup database and assume there is Spod.hx
        var obj = Spod.manager.get(1);
        obj.optfield = null;
        obj.update();    //Throws sql error
        }
    }

Please provide any additional information below.

issuesbot commented 11 years ago

[comment from ncanna...@gmail.com, published at 24/09/2011, 13:22:06] Should be fixed on SVN, thanks for reporting.