Ludicrousdb doesn't check and remove incompatible SQL modes when using mysqli
Created by: SeBsZ
On my local development server, some SQL_MODES are set globally such as NO_ZERO_DATE which is incompatible with MySQL, in fact that mode breaks the creation of new posts in Wordpress.
The default wp-db.php file checks for the currently set modes, strips the ones that are incompatible and then sets the new mode on line 861:
mysqli_query( $this->dbh, "SET SESSION sql_mode='$modes_str'" );
Ludicrousdb has the same set_sql_mode function on line 894, but it has a dbh_type_check() function which causes the set_sql_mode function to return when mysqli is being used! It then no longer removes the incompatible modes thus causing the incompatible sql modes to remain set, breaking Wordpress in some cases:
if ( $this->dbh_type_check( $dbh ) ) {
return;
}
Simply removing the above 3 lines fix the whole problem. Why was this check added to just quit if mysqli is detected?