Friday, April 20, 2007

Guess what...Wordpress does not like InnoDB + autocommit=off either

In my previous entry I wrote how to fix Wordpress so it can avoid a possible too restrictive default SQL_MODE. I guess I should have realized that the following two lines from my my.cnf option file would probably not be liked by Wordpress either:

default-storage-engine=InnoDB #Set the default storage engine (table type) for tables.
init-connect="set autocommit=0" #set autocommit off on connect

So, I went back and hacked wp-includes/wp-db.php again. Now the fix read:

// fix sql_mode
mysql_query("SET SESSION SQL_MODE := ''",$this->dbh);
mysql_query("SET SESSION AUTOCOMMIT=ON",$this->dbh);
// end fix sql_mode

Let's hope this was the last one ....


ymg said...

Roland, Did you file your patches in Wordpress's trac bug system

As Yoda says, "If in trac, your bug is not. Then a bug it is not. Hrrm!"

rpbouman said...

Hi Yusuf,

actually, I tried to file a bug, but somehow I could not log in...Probably due to me - it was really late at night for me....

I'd like to contribute the patch if you can call it that. However, I think a check should be added to figure out whether the MySQL server actually supports sql_mode. My fix just blindly assumes it does and might not go down well with older MySQL servers.

If you can help me get going with contributing the patches, I'd appreciate your help.



Year-to-Date on Synapse Analytics 5: Using Window Functions

For one of our Just-BI customers we implemented a Year-to-Date calculation in a Azure Synapse Backend. We encountered a couple of approache...