1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge branch '11.6' into 11.7

This commit is contained in:
Oleksandr Byelkin
2024-11-09 19:01:12 +01:00
789 changed files with 10342 additions and 4415 deletions

View File

@@ -247,7 +247,7 @@ public:
String &field_term,String &line_start,String &line_term,
String &enclosed,int escape,bool get_it_from_net, bool is_fifo);
~READ_INFO();
int read_field();
int read_field(CHARSET_INFO *cs);
int read_fixed_length(void);
int next_line(void);
char unescape(char chr);
@@ -1177,7 +1177,15 @@ read_sep_field(THD *thd, COPY_INFO &info, TABLE_LIST *table_list,
{
uint length;
uchar *pos;
if (read_info.read_field())
CHARSET_INFO *cs;
/*
Avoiding of handling binary data as a text
*/
if(item->charset_for_protocol() == &my_charset_bin)
cs= &my_charset_bin;
else
cs= read_info.charset();
if (read_info.read_field(cs))
break;
/* If this line is to be skipped we don't want to fill field or var */
@@ -1550,7 +1558,7 @@ inline bool READ_INFO::terminator(const uchar *ptr, uint length)
must make sure to use escapes properly.
*/
int READ_INFO::read_field()
int READ_INFO::read_field(CHARSET_INFO *cs)
{
int chr,found_enclosed_char;
@@ -1586,7 +1594,7 @@ int READ_INFO::read_field()
for (;;)
{
// Make sure we have enough space for the longest multi-byte character.
while (data.length() + charset()->mbmaxlen <= data.alloced_length())
while (data.length() + cs->mbmaxlen <= data.alloced_length())
{
chr = GET;
if (chr == my_b_EOF)
@@ -1672,7 +1680,7 @@ int READ_INFO::read_field()
}
}
data.append(chr);
if (charset()->use_mb() && read_mbtail(&data))
if (cs->use_mb() && read_mbtail(&data))
goto found_eof;
}
/*