From 304d1770f70f66659f350838e57eb0c98e063131 Mon Sep 17 00:00:00 2001 From: Jeremy Yang Date: Fri, 13 Jun 2025 12:23:55 +0100 Subject: [PATCH] parser: Fix EncFirstFreeFlagBit This commit fixes the FirstFreeFlagBit position to ensure proper offset for tree.FmtFlags. --- patches/0005-enc-first-free-flag.patch | 23 +++++++++++++++++++++++ pkg/sql/lexbase/encode.go | 8 ++++---- version | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 patches/0005-enc-first-free-flag.patch diff --git a/patches/0005-enc-first-free-flag.patch b/patches/0005-enc-first-free-flag.patch new file mode 100644 index 0000000..877c149 --- /dev/null +++ b/patches/0005-enc-first-free-flag.patch @@ -0,0 +1,23 @@ +diff --git a/pkg/sql/lexbase/encode.go b/pkg/sql/lexbase/encode.go +index 47b9a37..4f7bc03 100644 +--- a/pkg/sql/lexbase/encode.go ++++ b/pkg/sql/lexbase/encode.go +@@ -46,14 +46,14 @@ const ( + // without wrapping quotes. + EncBareReservedKeywords + +- // EncFirstFreeFlagBit needs to remain unused; it is used as base +- // bit offset for tree.FmtFlags. +- EncFirstFreeFlagBit +- + // EncAlwaysQuoted makes sure the string is always wrapped with quotes. + // This is used only to construct a statement against Oracle source, + // as Oracle is case insensitive if object name is not quoted. + EncAlwaysQuoted ++ ++ // EncFirstFreeFlagBit needs to remain unused; it is used as base ++ // bit offset for tree.FmtFlags. ++ EncFirstFreeFlagBit + ) + + // EncodeRestrictedSQLIdent writes the identifier in s to buf. The diff --git a/pkg/sql/lexbase/encode.go b/pkg/sql/lexbase/encode.go index 47b9a37..4f7bc03 100644 --- a/pkg/sql/lexbase/encode.go +++ b/pkg/sql/lexbase/encode.go @@ -46,14 +46,14 @@ const ( // without wrapping quotes. EncBareReservedKeywords - // EncFirstFreeFlagBit needs to remain unused; it is used as base - // bit offset for tree.FmtFlags. - EncFirstFreeFlagBit - // EncAlwaysQuoted makes sure the string is always wrapped with quotes. // This is used only to construct a statement against Oracle source, // as Oracle is case insensitive if object name is not quoted. EncAlwaysQuoted + + // EncFirstFreeFlagBit needs to remain unused; it is used as base + // bit offset for tree.FmtFlags. + EncFirstFreeFlagBit ) // EncodeRestrictedSQLIdent writes the identifier in s to buf. The diff --git a/version b/version index 96ffc12..cc227b4 100644 --- a/version +++ b/version @@ -1 +1 @@ -259c8a573eb2ba28643ffd55ee3bf6a438198c04 +4822ed2001ffba40aa96839344ffffad92020a2e