Remove isolation levels causing issue on some servers

This commit is contained in:
Mike Jolley 2016-01-15 11:43:06 +00:00
parent 734bde83f9
commit 2de38180d3
1 changed files with 3 additions and 9 deletions

View File

@ -858,17 +858,11 @@ function wc_array_cartesian( $input ) {
function wc_transaction_query( $type = 'start' ) {
global $wpdb;
if ( ! defined( 'WC_USE_TRANSACTIONS' ) ) {
// Try to set isolation level to support dirty reads - if this is unsupported, do not use transactions
$wpdb->hide_errors();
$result = $wpdb->query( 'SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;' );
if ( false === $result ) {
define( 'WC_USE_TRANSACTIONS', false );
} else {
if ( ! defined( 'WC_USE_TRANSACTIONS' ) ) {
define( 'WC_USE_TRANSACTIONS', true );
}
}
if ( WC_USE_TRANSACTIONS ) {
switch ( $type ) {