New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](variables) change column type of @@autocommit to BIGINT #33282
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
run buildall |
@@ -3206,14 +3205,14 @@ public void readFromJson(String json) throws IOException { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我觉得这么写太迷惑了,不如直接在加一个新的annotation,比如叫做converter="convertToFromBoolean"
然后在session variable 里定义一下。 这样就相当于只对auto commit 这一个变量做一下convert。
否则类似3208行,这是大面上都在做convert,未来很难扩展。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
05fd6a6
to
55f262b
Compare
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
TPC-H: Total hot run time: 38799 ms
|
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 38662 ms
|
TPC-DS: Total hot run time: 180699 ms
|
ClickBench: Total hot run time: 29.89 s
|
Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
|
Some of mysql connector (eg, dotnet MySQL.Data) rely on variable's column type to make connection. eg, `select @@autocommit` should with column type `BIGINT`, not `BIT`, otherwise it will throw error like: ``` System.FormatException: The input string 'True' was not in a correct format. at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value) at System.Convert.ToInt32(String value) at MySql.Data.MySqlClient.Driver.LoadCharacterSetsAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.Driver.ConfigureAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.MySqlConnection.Open() ``` In this PR, I add a new field of `VarAttr`: `convertBoolToLongMethod`, if set, it will convert boolean to long. And set it for `autocommit`
…#33282) Some of mysql connector (eg, dotnet MySQL.Data) rely on variable's column type to make connection. eg, `select @@autocommit` should with column type `BIGINT`, not `BIT`, otherwise it will throw error like: ``` System.FormatException: The input string 'True' was not in a correct format. at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value) at System.Convert.ToInt32(String value) at MySql.Data.MySqlClient.Driver.LoadCharacterSetsAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.Driver.ConfigureAsync(MySqlConnection connection, Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken) at MySql.Data.MySqlClient.MySqlConnection.Open() ``` In this PR, I add a new field of `VarAttr`: `convertBoolToLongMethod`, if set, it will convert boolean to long. And set it for `autocommit`
Proposed changes
Some of mysql connector (eg, dotnet MySQL.Data) rely on variable's column type to make connection.
eg,
select @@autocommit
should with column typeBIGINT
, notBIT
, otherwise it will throw error like:In this PR, I add a new field of
VarAttr
:convertBoolToLongMethod
, if set, it will convert boolean to long.And set it for
autocommit
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...