I just took the svn modx for a spin and found out a couple mysql quirks that may be causing some problems MySQL Server 5.0.22 on XP Pro with IIS, Fedora Core 5 with Apache have different behaviour in a couple places.
I’m using side-by-side development computers using eclipse 3.1 and phpeclipse for an ide. I tested the mysql statements using the mysql command line program only, so modx and the webserver environment shouldn’t be a factor.
Inserting into a NOT NULL column with no default value:
-------------------------------------------------------
CREATE TABLE test1 (id int(10) NOT NULL, stuff VARCHAR(32));
INSERT INTO test1 (stuff) VALUES ('some stuff');
W32 Mysql returns "ERROR 1364 (HY000): field ’id’ doesn’t have a default value" and doesn’t insert the row
linux mysql happily "makes up" a default value of 0, inserts the row, and doesn’t error out.
Running the latest SVN modx installer against the w32 mysql on W32 fails, the results screen gets down part way then quits with a message about some missing default (sorry, I didn’t write it down). Modx installs fine on the fedora box, and running the installer from the windows computer against the linux mysql server also installs fine.
Inserting a value with the wrong datatype in the sql string:
------------------------------------------------------------
In putzing around, I also got this error message on w32 in the manager area
error replacing into active users! SQL: REPLACE INTO `dougsdb`.modx2_active_users (internalKey, username, lasthit, action, id, ip) values(’1’, ’admin’, ’1159287384’, ’’, ’’, ’UNKNOWN’)
This lead to another mysql difference:
CREATE TABLE test1 (id int(10) NOT NULL, stuff VARCHAR(32), id2 int(10) DEFAULT NULL);
INSERT INTO test1 (id, stuff, id2) VALUES (0, 'some stuff', '');
w32 mysql returns "ERROR 1264 (22003): Out of range value adjusted for column ’id2’ at row 1", and the insert failed.
linux mysql happily inserts the row and makes up 0 for the value of id2.
I didn’t actually test REPLACE INTO but I’ll bet it behaves the same as insert.