Skip to content
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(mysql): fix databend float64 to mysql double #8745

Merged
merged 3 commits into from
Nov 11, 2022
Merged

fix(mysql): fix databend float64 to mysql double #8745

merged 3 commits into from
Nov 11, 2022

Conversation

FANNG1
Copy link

@FANNG1 FANNG1 commented Nov 11, 2022

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

Summary about this PR

Closes #issue

@vercel
Copy link

vercel bot commented Nov 11, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Nov 11, 2022 at 9:53AM (UTC)

@mergify mergify bot added the pr-bugfix this PR patches a bug in codebase label Nov 11, 2022
@FANNG1
Copy link
Author

FANNG1 commented Nov 11, 2022

cc @sundy-li

@xudong963 xudong963 requested a review from sundy-li November 11, 2022 05:05
@FANNG1
Copy link
Author

FANNG1 commented Nov 11, 2022

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Nov 11, 2022

update

☑️ Nothing to do

  • #commits-behind>0 [:pushpin: update requirement]
  • -closed [:pushpin: update requirement]

@FANNG1
Copy link
Author

FANNG1 commented Nov 11, 2022

BTW, all of databend integers are converted to MYSQL_TYPE_LONG, is this the expected behavior?

                TypeID::Int8 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int16 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int32 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int64 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt8 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt16 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt32 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt64 => Ok(ColumnType::MYSQL_TYPE_LONG),

@xudong963
Copy link
Member

BTW, all of databend integers are converted to MYSQL_TYPE_LONG, is this the expected behavior?

                TypeID::Int8 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int16 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int32 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::Int64 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt8 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt16 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt32 => Ok(ColumnType::MYSQL_TYPE_LONG),
                TypeID::UInt64 => Ok(ColumnType::MYSQL_TYPE_LONG),

I think it doesn't matter(no loss of precision).

@FANNG1
Copy link
Author

FANNG1 commented Nov 11, 2022

MYSQL_TYPE_LONG is 32bit not 64, seems we should use 'MYSQL_LONGLONG' for TypeID::Int64&uint64

@FANNG1
Copy link
Author

FANNG1 commented Nov 11, 2022

I think it doesn't matter(no loss of precision).

for me, I shoud pass databend data to hive, if I get query a small int column, databend produces long while hive expected small int, there maybe some problems. so I prefer to correct it like https://dev.mysql.com/doc/c-api/8.0/en/c-api-prepared-statement-type-codes.html.

@mergify mergify bot merged commit 0b0a6d1 into databendlabs:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix this PR patches a bug in codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants