File tree Expand file tree Collapse file tree
integrations/plugin-compatibility Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ function wp_sqlite_integration_plugin_compat( $query ) {
2828 return 'SELECT 1 WHERE 1=0 ' ;
2929 }
3030
31- // 2. Global fallback for FOR UPDATE / SKIP LOCKED.
31+ // 2. Global fallback for FOR UPDATE / SKIP LOCKED / NOWAIT .
3232 // This ensures the legacy driver natively ignores these locking constraints where SQLite faults.
33- // We use a non-destructive lookahead for whitespace, semicolon, or comments to avoid destroying strings .
33+ // We use a non-destructive lookahead for whitespace, semicolon, comments, or LIMIT .
3434 if ( stripos ( $ query , 'FOR UPDATE ' ) !== false ) {
35- $ query = preg_replace ( '/\s+FOR\s+UPDATE(?:\s+(?:SKIP\s+LOCKED|NOWAIT))?(?=\s*(?:;|\/\*|$))/i ' , '' , $ query );
35+ $ query = preg_replace ( '/\s+FOR\s+UPDATE(?:\s+(?:SKIP\s+LOCKED|NOWAIT))?(?=\s*(?:;|\/\*|$|\s+LIMIT ))/is ' , '' , $ query );
3636 }
3737
3838 // 3. Action Scheduler specific compatibility fixes.
You can’t perform that action at this time.
0 commit comments