Skip to content

Commit

Permalink
Merge branch '10.2' into 10.2-mdev9864
Browse files Browse the repository at this point in the history
  • Loading branch information
Galina Shalygina committed May 24, 2016
2 parents b4f1f42 + c7c2f8d commit 6c6c3af
Show file tree
Hide file tree
Showing 112 changed files with 2,344 additions and 2,193 deletions.
34 changes: 24 additions & 10 deletions client/mysql.cc
Expand Up @@ -5112,17 +5112,31 @@ static const char *construct_prompt()
processed_prompt.append("unknown");
break;
case 'h':
case 'H':
{
const char *prompt;
prompt= connected ? mysql_get_host_info(&mysql) : "not_connected";
if (strstr(prompt, "Localhost"))
processed_prompt.append("localhost");
else
{
const char *end=strcend(prompt,' ');
processed_prompt.append(prompt, (uint) (end-prompt));
}
break;
const char *prompt;
prompt= connected ? mysql_get_host_info(&mysql) : "not_connected";
if (strstr(prompt, "Localhost"))
{
if (*c == 'h')
processed_prompt.append("localhost");
else
{
static char hostname[FN_REFLEN];
if (hostname[0])
processed_prompt.append(hostname);
else if (gethostname(hostname, sizeof(hostname)) == 0)
processed_prompt.append(hostname);
else
processed_prompt.append("gethostname(2) failed");
}
}
else
{
const char *end=strcend(prompt,' ');
processed_prompt.append(prompt, (uint) (end-prompt));
}
break;
}
case 'p':
{
Expand Down
56 changes: 27 additions & 29 deletions client/mysqltest.cc
Expand Up @@ -6571,37 +6571,35 @@ int read_line(char *buf, int size)

if (!skip_char)
{
/* Could be a multibyte character */
/* This code is based on the code in "sql_load.cc" */
#ifdef USE_MB
int charlen = my_mbcharlen(charset_info, (unsigned char) c);
/* We give up if multibyte character is started but not */
/* completed before we pass buf_end */
if ((charlen > 1) && (p + charlen) <= buf_end)
*p++= c;
if (use_mb(charset_info))
{
int i;
char* mb_start = p;

*p++ = c;

for (i= 1; i < charlen; i++)
{
c= my_getc(cur_file->file);
if (feof(cur_file->file))
goto found_eof;
*p++ = c;
}
if (! my_ismbchar(charset_info, mb_start, p))
{
/* It was not a multiline char, push back the characters */
/* We leave first 'c', i.e. pretend it was a normal char */
while (p-1 > mb_start)
my_ungetc(*--p);
}
const char *mb_start= p - 1;
/* Could be a multibyte character */
/* See a similar code in "sql_load.cc" */
for ( ; p < buf_end; )
{
int charlen= my_charlen(charset_info, mb_start, p);
if (charlen > 0)
break; /* Full character */
if (MY_CS_IS_TOOSMALL(charlen))
{
/* We give up if multibyte character is started but not */
/* completed before we pass buf_end */
c= my_getc(cur_file->file);
if (feof(cur_file->file))
goto found_eof;
*p++ = c;
continue;
}
DBUG_ASSERT(charlen == MY_CS_ILSEQ);
/* It was not a multiline char, push back the characters */
/* We leave first 'c', i.e. pretend it was a normal char */
while (p - 1 > mb_start)
my_ungetc(*--p);
break;
}
}
else
#endif
*p++= c;
}
}
die("The input buffer is too small for this query.x\n" \
Expand Down
12 changes: 8 additions & 4 deletions debian/control
Expand Up @@ -443,14 +443,18 @@ Description: CrackLib Password Validation Plugin for MariaDB
This password validation plugin uses cracklib to allow only
sufficiently secure (as defined by cracklib) user passwords in MariaDB.

Package: mariadb-gssapi-server-10.1
Package: mariadb-gssapi-server-10.2
Section: database
Architecture: any
Depends: libgssapi-krb5-2, mariadb-server-10.1
Depends: libgssapi-krb5-2, mariadb-server-10.2
Conflicts: mariadb-gssapi-server-10.1
Replaces: mariadb-gssapi-server-10.1
Description: GSSAPI authentication plugin for MariaDB server

Package: mariadb-gssapi-client-10.1
Package: mariadb-gssapi-client-10.2
Section: database
Architecture: any
Depends: libgssapi-krb5-2, mariadb-client-10.1
Depends: libgssapi-krb5-2, mariadb-client-10.2
Conflicts: mariadb-gssapi-client-10.1
Replaces: mariadb-gssapi-client-10.1
Description: GSSAPI authentication plugin for MariaDB client
File renamed without changes.
File renamed without changes.
21 changes: 14 additions & 7 deletions include/m_ctype.h
Expand Up @@ -186,6 +186,7 @@ extern MY_UNI_CTYPE my_uni_ctype[256];

#define MY_SEQ_INTTAIL 1
#define MY_SEQ_SPACES 2
#define MY_SEQ_NONSPACES 3 /* Skip non-space characters, including bad bytes */

/* My charsets_list flags */
#define MY_CS_COMPILED 1 /* compiled-in sets */
Expand Down Expand Up @@ -403,7 +404,6 @@ struct my_charset_handler_st
{
my_bool (*init)(struct charset_info_st *, MY_CHARSET_LOADER *loader);
/* Multibyte routines */
uint (*mbcharlen)(CHARSET_INFO *, uint c);
size_t (*numchars)(CHARSET_INFO *, const char *b, const char *e);
size_t (*charpos)(CHARSET_INFO *, const char *b, const char *e,
size_t pos);
Expand Down Expand Up @@ -779,7 +779,6 @@ size_t my_well_formed_char_length_8bit(CHARSET_INFO *cs,
size_t nchars,
MY_STRCOPY_STATUS *status);
int my_charlen_8bit(CHARSET_INFO *, const uchar *str, const uchar *end);
uint my_mbcharlen_8bit(CHARSET_INFO *, uint c);


/* Functions for multibyte charsets */
Expand Down Expand Up @@ -1010,11 +1009,19 @@ int my_charlen(CHARSET_INFO *cs, const char *str, const char *end)
return (cs->cset->charlen)(cs, (const uchar *) str,
(const uchar *) end);
}
#ifdef USE_MB
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
#else
#define my_mbcharlen(s, a) 1
#endif


/**
Convert broken and incomplete byte sequences to 1 byte.
*/
static inline
uint my_charlen_fix(CHARSET_INFO *cs, const char *str, const char *end)
{
int char_length= my_charlen(cs, str, end);
DBUG_ASSERT(str < end);
return char_length > 0 ? (uint) char_length : (uint) 1U;
}


#define my_caseup_str(s, a) ((s)->cset->caseup_str((s), (a)))
#define my_casedn_str(s, a) ((s)->cset->casedn_str((s), (a)))
Expand Down
3 changes: 2 additions & 1 deletion libmysqld/lib_sql.cc
Expand Up @@ -1170,7 +1170,8 @@ bool Protocol_binary::write()
bool
net_send_ok(THD *thd,
uint server_status, uint statement_warn_count,
ulonglong affected_rows, ulonglong id, const char *message)
ulonglong affected_rows, ulonglong id, const char *message,
bool unused __attribute__((unused)))
{
DBUG_ENTER("emb_net_send_ok");
MYSQL_DATA *data;
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc
Expand Up @@ -1651,7 +1651,7 @@ FLUSH LOGS;
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001

--echo #
Expand Down Expand Up @@ -1731,7 +1731,7 @@ FLUSH LOGS;
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001

--echo #
Expand Down Expand Up @@ -1854,7 +1854,7 @@ FLUSH LOGS;
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001

--echo #
Expand Down Expand Up @@ -1912,7 +1912,7 @@ FLUSH LOGS;
--echo #
let $MYSQLD_DATADIR= `select @@datadir`;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9-]*[.][0-9]{1,3})[0-9e+-]*[^ ]*[ ]*(.*(FLOAT|DOUBLE).*[*].)/\1... \2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001

--echo #
Expand Down
17 changes: 17 additions & 0 deletions mysql-test/r/cte_nonrecursive.result
Expand Up @@ -763,3 +763,20 @@ a
30
drop view v1;
drop table t1;
#
# Bug mdev-10058: Invalid derived table with WITH clause
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t2 VALUES (1),(2),(3);
INSERT INTO t3 VALUES (1),(2),(3);
SELECT * FROM (WITH a AS (SELECT * FROM t1) (t2 NATURAL JOIN t3));
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't2 NATURAL JOIN t3))' at line 1
SELECT * FROM (WITH a AS (SELECT * FROM t1) SELECT * FROM t2 NATURAL JOIN t3) AS d1;
a
1
2
3
DROP TABLE t1,t2,t3;
2 changes: 1 addition & 1 deletion mysql-test/r/func_analyse.result
Expand Up @@ -159,7 +159,7 @@ Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_
Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype
1 1 1 1 1 0 0 1.0000 0.0000 ENUM('1') NOT NULL
SELECT * FROM t1 UNION SELECT * FROM t1 PROCEDURE analyse();
ERROR HY000: Incorrect usage of PROCEDURE and subquery
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PROCEDURE analyse()' at line 1
#
# MDEV-10030 sql_yacc.yy: Split table_expression and remove PROCEDURE from create_select, select_paren_derived, select_derived2, query_specification
#
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/r/join.result
Expand Up @@ -1476,7 +1476,7 @@ DROP TABLE t1,t2,t3,t4,t5;
# MDEV-4752: Segfault during parsing of illegal query
#
SELECT * FROM t5 JOIN (t1 JOIN t2 UNION SELECT * FROM t3 JOIN t4);
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT * FROM t3 JOIN t4)' at line 1
#
# MDEV-4959: join of const table with NULL fields
#
Expand Down
6 changes: 2 additions & 4 deletions mysql-test/r/limit_rows_examined.result
Expand Up @@ -173,10 +173,8 @@ Warning 1931 Query execution was interrupted. The query examined at least 8 rows
select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0
UNION
select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6;
c1 c2
bb bb
Warnings:
Warning 1931 Query execution was interrupted. The query examined at least 8 rows, which exceeds LIMIT ROWS EXAMINED (6). The query result may be incomplete.
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION
select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 6' at line 2
(select * from t1, t2 where c1 = c2 LIMIT ROWS EXAMINED 0)
UNION
(select * from t1, t2 where c1 < c2 LIMIT ROWS EXAMINED 0)
Expand Down

0 comments on commit 6c6c3af

Please sign in to comment.