refactor types
package to decouple it from stmtctx
#47355
Labels
type/enhancement
The issue or PR belongs to an enhancement.
Enhancement
Currently, the package
types
methods rely on the packagestmtctx
as the context for value conversion. We'd better toavoid it and decouple these two packages for some reasons:
types
is a basic package, it should not have an assumption that all the value operations happen in a statement of SQL.stmtctx.StatementContext
has too many fields and is challenging to use. We should a simple object for context with clear semanticsFor above reasons, we should redesign the context in
package
to introduce a new context namedtypes.Context
. For example:The new context definition has some fields:
It's better to make the
Context
as immutable to make it thread-safe and easier to use. So the inner fields are designed to be private.The
Flags
type will be defined as an int with each bit stands for a flag:sub tasks
FlagSkipXXXCheck
to in types.Context to determine whether to check the string or not #47479stmtctx.StatementContext
intoTypeCtx
#47590types.StrictFlags
more strict #47829types
package #47507types
package #47508types
package #47517FlagClipNegativeToZero
to handle clip to zero case intypes
package #47518types
package #47511explicitTz
fromtypes.ParseTime
#48573stmtctx
frompkg/util/dbutil
#48911*ctx
to remove memory allocation #49277stmtctx
dependency fromtablecodec
androwcodec
#48751The text was updated successfully, but these errors were encountered: