Remove isolation levels causing issue on some servers
This commit is contained in:
parent
734bde83f9
commit
2de38180d3
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in New Issue