Skip to content

Commit f922251

Browse files
committed
Improve non-strict mode method docs
1 parent d6f6b6d commit f922251

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

wp-includes/sqlite-ast/class-wp-sqlite-driver.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,14 @@ private function translate_show_like_or_where_condition( WP_Parser_Node $like_or
28882888
}
28892889

28902890
/**
2891-
* Translate INSERT body, emulating MySQL implicit defaults in non-strict mode.
2891+
* Translate INSERT or REPLACE statement body to SQLite, while emulating
2892+
* the behavior of MySQL implicit default values in non-strict mode.
2893+
*
2894+
* Rewrites a statement body in the following form:
2895+
* INSERT INTO table (optionally some columns) <select-or-values>
2896+
* To a statement body with the following structure:
2897+
* INSERT INTO table (all table columns)
2898+
* SELECT <non-strict-mode-adjusted-values> FROM (<select-or-values>) WHERE true
28922899
*
28932900
* In MySQL, the behavior of INSERT and UPDATE statements depends on whether
28942901
* the STRICT_TRANS_TABLES (InnoDB) or STRICT_ALL_TABLES SQL mode is enabled.
@@ -3024,6 +3031,11 @@ private function translate_insert_or_replace_body_in_non_strict_mode(
30243031
/**
30253032
* Translate UPDATE list, emulating MySQL implicit defaults in non-strict mode.
30263033
*
3034+
* Rewrites an UPDATE statement list in the following form:
3035+
* UPDATE table SET <non-null-column> = <value>
3036+
* To a list with the following structure:
3037+
* UPDATE table SET <non-null-column> = COALESCE(<value>, <implicit-default>)
3038+
*
30273039
* In MySQL, the behavior of INSERT and UPDATE statements depends on whether
30283040
* the STRICT_TRANS_TABLES (InnoDB) or STRICT_ALL_TABLES SQL mode is enabled.
30293041
*

0 commit comments

Comments
 (0)