-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
67291: execgen: preserve comments around callsite of inlined function r=DrewKimball a=DrewKimball This patch modifies the execgen `inline` directive to ensure that comments before and after the callsites of inlined functions are not removed. Example: ``` func a() { // This comment should not be removed. b() // This one too. } // execgen:inline func b() { foo = bar } => func a() { // This comment should not be removed. { foo = bar } // This one too. } // execgen:inline const _ = "inlined_b" ``` Release note: None 67343: sql: support backslash_quote session setting r=ZhouXing19 a=ZhouXing19 This setting is based on a previous issue: #45774. This commit set a placeholder for PostgreSQL configuration setting called [backslash_quote](https://www.postgresql.org/docs/12/runtime-config-compatible.html#GUC-BACKSLASH-QUOTE), and ensured it is compatible with ORMS. Currently, we only allow the value to be `backslash_quote`. If `client_encoding` is updated to allow encodings other than UTF8, then the default value of `backslash_quote` should be changed to `on`. When users try setting the backslash_quote session variable, CRDB will let it pass, but not making any changes. We leave the functionality implementation to future works. Details: - Added `backslash_quote` at varGen at `sql/vars.go` without implementing the true functionality - Tested it with `subtest backslash_quote_test` at `pkg/sql/logictest/testdata/logic_test/set` - Removed `backslash_quote` from `unsupported_vars.go` Passed local test: <img src="https://i.imgur.com/crZFk9w.png"> Updates: - nil: updated url for backslash_quote, and removed extra spaces - Deleted `backslash_quote` from `unsupported_vars.go` - Ran `make testlogic FILES=information_schema TESTFLAGS=-rewrite` Release note (sql change): Added session variable backslash_quote for compatibility, setting it does a no-op, and only `safe_encoding` is supported. 67399: execgen: fix template function names with argument comments r=mgartner a=mgartner #### execgen: do not silently err when producing output string Previously, execgen would silently fail if `decorator.Fprint` returned an error. This could happen if templating logic created an invalid DST. The result of the silent failure was an empty `.eg.go` file without any indication of what went wrong. Errors are now more explicit which should give us a starting place for tracking down templating bugs. Release note: None #### execgen: fix template function names with argument comments Previously, execgen would generate invalid DSTs for template function variants when call sites had comments describing an argument. For example: func a() { b(true /* t */) } // execgen:inline // execgen:template<t> func b(t bool) { // ... } This would produce a template function variant with `/* t */`, which was invalid because it contains spaces. Template argument decorations are now cleared to avoid this issue. Release note: None Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: Jane Xing <[email protected]> Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information
Showing
13 changed files
with
111 additions
and
3 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters