-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Format ODBCDriver2 with NULL support #2834
Conversation
* ODBC driver is designed to be build for different platforms without dependencies from the main code, | ||
* so the format is made that way so that it can be as easy as possible to parse it. | ||
* A header is displayed with the required information. | ||
* The data is then output in the order of the rows. Each value is displayed as follows: length in VarUInt format, then data in text form. |
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.
.
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.
.
|
||
void writeODBCString(WriteBuffer & out, const char * cstr) | ||
{ | ||
std::string str{cstr}; |
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.
Excessive allocation.
out.write(str.data(), str.size()); | ||
} | ||
|
||
void writeODBCString(WriteBuffer & out, const char * cstr) |
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.
No need for this method. It will work automatically by implicit type conversion.
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.
it does not work for writeODBCString(out, "woow")
} | ||
} | ||
|
||
void ODBCDriver2BlockOutputStream::writePrefix() |
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.
I cannot understand the motivation behind this format.
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.
expandable header without breaking format - we can send any column flags, for example length for display_size or something else
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en