mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
Merge branch 'bb-10.0-serg' into 10.0
This commit is contained in:
commit
f9b5acfb0c
620 changed files with 34481 additions and 12539 deletions
|
|
@ -235,8 +235,6 @@ my_bool
|
|||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
switch(optid) {
|
||||
case 'c':
|
||||
opt_count_iterations= 1;
|
||||
|
|
@ -284,8 +282,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
break;
|
||||
case '?':
|
||||
case 'I': /* Info */
|
||||
error++;
|
||||
break;
|
||||
usage();
|
||||
exit(0);
|
||||
case OPT_CHARSETS_DIR:
|
||||
#if MYSQL_VERSION_ID > 32300
|
||||
charsets_dir = argument;
|
||||
|
|
@ -296,11 +294,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
opt->name);
|
||||
break;
|
||||
}
|
||||
if (error)
|
||||
{
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ static void dbDisconnect(char *host);
|
|||
static void DBerror(MYSQL *mysql, const char *when);
|
||||
static void safe_exit(int error);
|
||||
static void print_result();
|
||||
static uint fixed_name_length(const char *name);
|
||||
static size_t fixed_name_length(const char *name);
|
||||
static char *fix_table_name(char *dest, char *src);
|
||||
int what_to_do = 0;
|
||||
|
||||
|
|
@ -594,10 +594,10 @@ static int process_selected_tables(char *db, char **table_names, int tables)
|
|||
} /* process_selected_tables */
|
||||
|
||||
|
||||
static uint fixed_name_length(const char *name)
|
||||
static size_t fixed_name_length(const char *name)
|
||||
{
|
||||
const char *p;
|
||||
uint extra_length= 2; /* count the first/last backticks */
|
||||
size_t extra_length= 2; /* count the first/last backticks */
|
||||
DBUG_ENTER("fixed_name_length");
|
||||
|
||||
for (p= name; *p; p++)
|
||||
|
|
@ -605,7 +605,7 @@ static uint fixed_name_length(const char *name)
|
|||
if (*p == '`')
|
||||
extra_length++;
|
||||
}
|
||||
DBUG_RETURN((uint) ((p - name) + extra_length));
|
||||
DBUG_RETURN((size_t) ((p - name) + extra_length));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -664,7 +664,7 @@ static int process_all_tables_in_db(char *database)
|
|||
*/
|
||||
|
||||
char *tables, *end;
|
||||
uint tot_length = 0;
|
||||
size_t tot_length = 0;
|
||||
|
||||
char *views, *views_end;
|
||||
uint tot_views_length = 0;
|
||||
|
|
@ -769,7 +769,9 @@ static int fix_table_storage_name(const char *name)
|
|||
|
||||
if (strncmp(name, "#mysql50#", 9))
|
||||
DBUG_RETURN(1);
|
||||
sprintf(qbuf, "RENAME TABLE `%s` TO `%s`", name, name + 9);
|
||||
my_snprintf(qbuf, sizeof(qbuf), "RENAME TABLE %`s TO %`s",
|
||||
name, name + 9);
|
||||
|
||||
rc= run_query(qbuf, 1);
|
||||
if (verbose)
|
||||
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
|
||||
|
|
@ -784,7 +786,8 @@ static int fix_database_storage_name(const char *name)
|
|||
|
||||
if (strncmp(name, "#mysql50#", 9))
|
||||
DBUG_RETURN(1);
|
||||
sprintf(qbuf, "ALTER DATABASE `%s` UPGRADE DATA DIRECTORY NAME", name);
|
||||
my_snprintf(qbuf, sizeof(qbuf), "ALTER DATABASE %`s UPGRADE DATA DIRECTORY "
|
||||
"NAME", name);
|
||||
rc= run_query(qbuf, 1);
|
||||
if (verbose)
|
||||
printf("%-50s %s\n", name, rc ? "FAILED" : "OK");
|
||||
|
|
@ -806,7 +809,7 @@ static int rebuild_table(char *name)
|
|||
ptr= strxmov(ptr, " FORCE", NullS);
|
||||
if (verbose >= 3)
|
||||
puts(query);
|
||||
if (mysql_real_query(sock, query, (uint)(ptr - query)))
|
||||
if (mysql_real_query(sock, query, (ulong)(ptr - query)))
|
||||
{
|
||||
fprintf(stderr, "Failed to %s\n", query);
|
||||
fprintf(stderr, "Error: %s\n", mysql_error(sock));
|
||||
|
|
@ -870,7 +873,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
|
|||
{
|
||||
char *query, *end, options[100], message[100];
|
||||
char table_name_buff[NAME_CHAR_LEN*2*2+1], *table_name;
|
||||
uint query_length= 0;
|
||||
size_t query_length= 0, query_size= sizeof(char)*(length+110);
|
||||
const char *op = 0;
|
||||
const char *tab_view;
|
||||
DBUG_ENTER("handle_request_for_tables");
|
||||
|
|
@ -923,10 +926,12 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
|
|||
DBUG_RETURN(fix_table_storage_name(tables));
|
||||
}
|
||||
|
||||
if (!(query =(char *) my_malloc((sizeof(char)*(length+110)), MYF(MY_WME))))
|
||||
if (!(query =(char *) my_malloc(query_size, MYF(MY_WME))))
|
||||
DBUG_RETURN(1);
|
||||
if (opt_all_in_1)
|
||||
{
|
||||
DBUG_ASSERT(strlen(op)+strlen(tables)+strlen(options)+8+1 <= query_size);
|
||||
|
||||
/* No backticks here as we added them before */
|
||||
query_length= sprintf(query, "%s%s%s %s", op,
|
||||
tab_view, tables, options);
|
||||
|
|
@ -942,7 +947,7 @@ static int handle_request_for_tables(char *tables, size_t length, my_bool view)
|
|||
(int) (ptr - org)));
|
||||
table_name= table_name_buff;
|
||||
ptr= strxmov(ptr, " ", options, NullS);
|
||||
query_length= (uint) (ptr - query);
|
||||
query_length= (size_t) (ptr - query);
|
||||
}
|
||||
if (verbose >= 3)
|
||||
puts(query);
|
||||
|
|
@ -1208,7 +1213,7 @@ int main(int argc, char **argv)
|
|||
process_databases(argv);
|
||||
if (opt_auto_repair)
|
||||
{
|
||||
uint i;
|
||||
size_t i;
|
||||
|
||||
if (!opt_silent && (tables4repair.elements || tables4rebuild.elements))
|
||||
puts("\nRepairing tables");
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@
|
|||
|
||||
static void add_load_option(DYNAMIC_STRING *str, const char *option,
|
||||
const char *option_value);
|
||||
static ulong find_set(TYPELIB *lib, const char *x, uint length,
|
||||
static ulong find_set(TYPELIB *lib, const char *x, size_t length,
|
||||
char **err_pos, uint *err_len);
|
||||
static char *alloc_query_str(ulong size);
|
||||
|
||||
|
|
@ -890,7 +890,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
opt_set_charset= 0;
|
||||
opt_compatible_mode_str= argument;
|
||||
opt_compatible_mode= find_set(&compatible_mode_typelib,
|
||||
argument, (uint) strlen(argument),
|
||||
argument, strlen(argument),
|
||||
&err_ptr, &err_len);
|
||||
if (err_len)
|
||||
{
|
||||
|
|
@ -900,7 +900,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
}
|
||||
#if !defined(DBUG_OFF)
|
||||
{
|
||||
uint size_for_sql_mode= 0;
|
||||
size_t size_for_sql_mode= 0;
|
||||
const char **ptr;
|
||||
for (ptr= compatible_mode_names; *ptr; ptr++)
|
||||
size_for_sql_mode+= strlen(*ptr);
|
||||
|
|
@ -1171,8 +1171,8 @@ static int fetch_db_collation(const char *db_name,
|
|||
break;
|
||||
}
|
||||
|
||||
strncpy(db_cl_name, db_cl_row[0], db_cl_size);
|
||||
db_cl_name[db_cl_size - 1]= 0; /* just in case. */
|
||||
strncpy(db_cl_name, db_cl_row[0], db_cl_size-1);
|
||||
db_cl_name[db_cl_size - 1]= 0;
|
||||
|
||||
} while (FALSE);
|
||||
|
||||
|
|
@ -1305,7 +1305,7 @@ get_gtid_pos(char *out_gtid_pos, int master)
|
|||
|
||||
|
||||
static char *my_case_str(const char *str,
|
||||
uint str_len,
|
||||
size_t str_len,
|
||||
const char *token,
|
||||
uint token_len)
|
||||
{
|
||||
|
|
@ -1521,7 +1521,7 @@ static int switch_character_set_results(MYSQL *mysql, const char *cs_name)
|
|||
*/
|
||||
|
||||
static char *cover_definer_clause(const char *stmt_str,
|
||||
uint stmt_length,
|
||||
size_t stmt_length,
|
||||
const char *definer_version_str,
|
||||
uint definer_version_length,
|
||||
const char *stmt_version_str,
|
||||
|
|
@ -1721,14 +1721,14 @@ static void dbDisconnect(char *host)
|
|||
} /* dbDisconnect */
|
||||
|
||||
|
||||
static void unescape(FILE *file,char *pos,uint length)
|
||||
static void unescape(FILE *file,char *pos, size_t length)
|
||||
{
|
||||
char *tmp;
|
||||
DBUG_ENTER("unescape");
|
||||
if (!(tmp=(char*) my_malloc(length*2+1, MYF(MY_WME))))
|
||||
die(EX_MYSQLERR, "Couldn't allocate memory");
|
||||
|
||||
mysql_real_escape_string(&mysql_connection, tmp, pos, length);
|
||||
mysql_real_escape_string(&mysql_connection, tmp, pos, (ulong)length);
|
||||
fputc('\'', file);
|
||||
fputs(tmp, file);
|
||||
fputc('\'', file);
|
||||
|
|
@ -1842,7 +1842,7 @@ static char *quote_for_like(const char *name, char *buff)
|
|||
Quote '<' '>' '&' '\"' chars and print a string to the xml_file.
|
||||
*/
|
||||
|
||||
static void print_quoted_xml(FILE *xml_file, const char *str, ulong len,
|
||||
static void print_quoted_xml(FILE *xml_file, const char *str, size_t len,
|
||||
my_bool is_attribute_name)
|
||||
{
|
||||
const char *end;
|
||||
|
|
@ -2103,7 +2103,7 @@ static void print_xml_row(FILE *xml_file, const char *row_name,
|
|||
squeezed to a single hyphen.
|
||||
*/
|
||||
|
||||
static void print_xml_comment(FILE *xml_file, ulong len,
|
||||
static void print_xml_comment(FILE *xml_file, size_t len,
|
||||
const char *comment_string)
|
||||
{
|
||||
const char* end;
|
||||
|
|
@ -2220,7 +2220,7 @@ static uint dump_events_for_db(char *db)
|
|||
DBUG_ENTER("dump_events_for_db");
|
||||
DBUG_PRINT("enter", ("db: '%s'", db));
|
||||
|
||||
mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
|
||||
mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
|
||||
|
||||
/* nice comments */
|
||||
print_comment(sql_file, 0,
|
||||
|
|
@ -2340,7 +2340,6 @@ static uint dump_events_for_db(char *db)
|
|||
(const char *) delimiter);
|
||||
|
||||
my_free(query_str);
|
||||
|
||||
restore_time_zone(sql_file, delimiter);
|
||||
restore_sql_mode(sql_file, delimiter);
|
||||
|
||||
|
|
@ -2433,7 +2432,7 @@ static uint dump_routines_for_db(char *db)
|
|||
DBUG_ENTER("dump_routines_for_db");
|
||||
DBUG_PRINT("enter", ("db: '%s'", db));
|
||||
|
||||
mysql_real_escape_string(mysql, db_name_buff, db, strlen(db));
|
||||
mysql_real_escape_string(mysql, db_name_buff, db, (ulong)strlen(db));
|
||||
|
||||
/* nice comments */
|
||||
print_comment(sql_file, 0,
|
||||
|
|
@ -2491,9 +2490,9 @@ static uint dump_routines_for_db(char *db)
|
|||
if the user has EXECUTE privilege he see routine names, but NOT the
|
||||
routine body of other routines that are not the creator of!
|
||||
*/
|
||||
DBUG_PRINT("info",("length of body for %s row[2] '%s' is %d",
|
||||
DBUG_PRINT("info",("length of body for %s row[2] '%s' is %zu",
|
||||
routine_name, row[2] ? row[2] : "(null)",
|
||||
row[2] ? (int) strlen(row[2]) : 0));
|
||||
row[2] ? strlen(row[2]) : 0));
|
||||
if (row[2] == NULL)
|
||||
{
|
||||
print_comment(sql_file, 1, "\n-- insufficient privileges to %s\n",
|
||||
|
|
@ -4076,7 +4075,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
|
|||
int i;
|
||||
char name_buff[NAME_LEN*2+3];
|
||||
|
||||
mysql_real_escape_string(mysql, name_buff, db, strlen(db));
|
||||
mysql_real_escape_string(mysql, name_buff, db, (ulong)strlen(db));
|
||||
|
||||
init_dynamic_string_checked(&dynamic_where, " AND TABLESPACE_NAME IN ("
|
||||
"SELECT DISTINCT TABLESPACE_NAME FROM"
|
||||
|
|
@ -4089,7 +4088,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
|
|||
for (i=0 ; i<tables ; i++)
|
||||
{
|
||||
mysql_real_escape_string(mysql, name_buff,
|
||||
table_names[i], strlen(table_names[i]));
|
||||
table_names[i], (ulong)strlen(table_names[i]));
|
||||
|
||||
dynstr_append_checked(&dynamic_where, "'");
|
||||
dynstr_append_checked(&dynamic_where, name_buff);
|
||||
|
|
@ -4119,7 +4118,7 @@ static int dump_tablespaces_for_databases(char** databases)
|
|||
{
|
||||
char db_name_buff[NAME_LEN*2+3];
|
||||
mysql_real_escape_string(mysql, db_name_buff,
|
||||
databases[i], strlen(databases[i]));
|
||||
databases[i], (ulong)strlen(databases[i]));
|
||||
dynstr_append_checked(&dynamic_where, "'");
|
||||
dynstr_append_checked(&dynamic_where, db_name_buff);
|
||||
dynstr_append_checked(&dynamic_where, "',");
|
||||
|
|
@ -5320,7 +5319,7 @@ static int start_transaction(MYSQL *mysql_con)
|
|||
}
|
||||
|
||||
|
||||
static ulong find_set(TYPELIB *lib, const char *x, uint length,
|
||||
static ulong find_set(TYPELIB *lib, const char *x, size_t length,
|
||||
char **err_pos, uint *err_len)
|
||||
{
|
||||
const char *end= x + length;
|
||||
|
|
@ -5378,7 +5377,7 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row,
|
|||
fputc(' ',file);
|
||||
fputs(prefix, file);
|
||||
if (string_value)
|
||||
unescape(file,row[0],(uint) strlen(row[0]));
|
||||
unescape(file,row[0], strlen(row[0]));
|
||||
else
|
||||
fputs(row[0], file);
|
||||
check_io(file);
|
||||
|
|
@ -5632,8 +5631,8 @@ static my_bool get_view_structure(char *table, char* db)
|
|||
verbose_msg("-- Retrieving view structure for table %s...\n", table);
|
||||
|
||||
#ifdef NOT_REALLY_USED_YET
|
||||
sprintf(insert_pat, "SET SQL_QUOTE_SHOW_CREATE=%d",
|
||||
(opt_quoted || opt_keywords));
|
||||
dynstr_append_checked(&insert_pat, "SET SQL_QUOTE_SHOW_CREATE=");
|
||||
dynstr_append_checked(&insert_pat, (opt_quoted || opt_keywords)? "1":"0");
|
||||
#endif
|
||||
|
||||
result_table= quote_name(table, table_buff, 1);
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ static int list_tables(MYSQL *mysql,const char *db,const char *table);
|
|||
static int list_table_status(MYSQL *mysql,const char *db,const char *table);
|
||||
static int list_fields(MYSQL *mysql,const char *db,const char *table,
|
||||
const char *field);
|
||||
static void print_header(const char *header,uint head_length,...);
|
||||
static void print_row(const char *header,uint head_length,...);
|
||||
static void print_trailer(uint length,...);
|
||||
static void print_header(const char *header,size_t head_length,...);
|
||||
static void print_row(const char *header,size_t head_length,...);
|
||||
static void print_trailer(size_t length,...);
|
||||
static void print_res_header(MYSQL_RES *result);
|
||||
static void print_res_top(MYSQL_RES *result);
|
||||
static void print_res_row(MYSQL_RES *result,MYSQL_ROW cur);
|
||||
|
|
@ -379,7 +379,8 @@ static int
|
|||
list_dbs(MYSQL *mysql,const char *wild)
|
||||
{
|
||||
const char *header;
|
||||
uint length, counter = 0;
|
||||
size_t length = 0;
|
||||
uint counter = 0;
|
||||
ulong rowcount = 0L;
|
||||
char tables[NAME_LEN+1], rows[NAME_LEN+1];
|
||||
char query[NAME_LEN + 100];
|
||||
|
|
@ -417,7 +418,7 @@ list_dbs(MYSQL *mysql,const char *wild)
|
|||
printf("Wildcard: %s\n",wild);
|
||||
|
||||
header="Databases";
|
||||
length=(uint) strlen(header);
|
||||
length= strlen(header);
|
||||
field=mysql_fetch_field(result);
|
||||
if (length < field->max_length)
|
||||
length=field->max_length;
|
||||
|
|
@ -505,7 +506,8 @@ static int
|
|||
list_tables(MYSQL *mysql,const char *db,const char *table)
|
||||
{
|
||||
const char *header;
|
||||
uint head_length, counter = 0;
|
||||
size_t head_length;
|
||||
uint counter = 0;
|
||||
char query[NAME_LEN + 100], rows[NAME_LEN], fields[16];
|
||||
MYSQL_FIELD *field;
|
||||
MYSQL_RES *result;
|
||||
|
|
@ -542,7 +544,7 @@ list_tables(MYSQL *mysql,const char *db,const char *table)
|
|||
putchar('\n');
|
||||
|
||||
header="Tables";
|
||||
head_length=(uint) strlen(header);
|
||||
head_length= strlen(header);
|
||||
field=mysql_fetch_field(result);
|
||||
if (head_length < field->max_length)
|
||||
head_length=field->max_length;
|
||||
|
|
@ -660,7 +662,7 @@ list_table_status(MYSQL *mysql,const char *db,const char *wild)
|
|||
len= sizeof(query);
|
||||
len-= my_snprintf(query, len, "show table status from `%s`", db);
|
||||
if (wild && wild[0] && len)
|
||||
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
|
||||
strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
|
||||
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
|
||||
{
|
||||
fprintf(stderr,"%s: Cannot get status for db: %s, table: %s: %s\n",
|
||||
|
|
@ -693,7 +695,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
|
|||
const char *wild)
|
||||
{
|
||||
char query[NAME_LEN + 100];
|
||||
int len;
|
||||
size_t len;
|
||||
MYSQL_RES *result;
|
||||
MYSQL_ROW row;
|
||||
ulong UNINIT_VAR(rows);
|
||||
|
|
@ -723,7 +725,7 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
|
|||
len-= my_snprintf(query, len, "show /*!32332 FULL */ columns from `%s`",
|
||||
table);
|
||||
if (wild && wild[0] && len)
|
||||
strxnmov(query + strlen(query), len, " like '", wild, "'", NullS);
|
||||
strxnmov(query + strlen(query), len - 1, " like '", wild, "'", NullS);
|
||||
if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
|
||||
{
|
||||
fprintf(stderr,"%s: Cannot list columns in db: %s, table: %s: %s\n",
|
||||
|
|
@ -771,10 +773,10 @@ list_fields(MYSQL *mysql,const char *db,const char *table,
|
|||
*****************************************************************************/
|
||||
|
||||
static void
|
||||
print_header(const char *header,uint head_length,...)
|
||||
print_header(const char *header,size_t head_length,...)
|
||||
{
|
||||
va_list args;
|
||||
uint length,i,str_length,pre_space;
|
||||
size_t length,i,str_length,pre_space;
|
||||
const char *field;
|
||||
|
||||
va_start(args,head_length);
|
||||
|
|
@ -797,10 +799,10 @@ print_header(const char *header,uint head_length,...)
|
|||
putchar('|');
|
||||
for (;;)
|
||||
{
|
||||
str_length=(uint) strlen(field);
|
||||
str_length= strlen(field);
|
||||
if (str_length > length)
|
||||
str_length=length+1;
|
||||
pre_space=(uint) (((int) length-(int) str_length)/2)+1;
|
||||
pre_space= ((length- str_length)/2)+1;
|
||||
for (i=0 ; i < pre_space ; i++)
|
||||
putchar(' ');
|
||||
for (i = 0 ; i < str_length ; i++)
|
||||
|
|
@ -834,11 +836,11 @@ print_header(const char *header,uint head_length,...)
|
|||
|
||||
|
||||
static void
|
||||
print_row(const char *header,uint head_length,...)
|
||||
print_row(const char *header,size_t head_length,...)
|
||||
{
|
||||
va_list args;
|
||||
const char *field;
|
||||
uint i,length,field_length;
|
||||
size_t i,length,field_length;
|
||||
|
||||
va_start(args,head_length);
|
||||
field=header; length=head_length;
|
||||
|
|
@ -847,7 +849,7 @@ print_row(const char *header,uint head_length,...)
|
|||
putchar('|');
|
||||
putchar(' ');
|
||||
fputs(field,stdout);
|
||||
field_length=(uint) strlen(field);
|
||||
field_length= strlen(field);
|
||||
for (i=field_length ; i <= length ; i++)
|
||||
putchar(' ');
|
||||
if (!(field=va_arg(args,char *)))
|
||||
|
|
@ -861,10 +863,10 @@ print_row(const char *header,uint head_length,...)
|
|||
|
||||
|
||||
static void
|
||||
print_trailer(uint head_length,...)
|
||||
print_trailer(size_t head_length,...)
|
||||
{
|
||||
va_list args;
|
||||
uint length,i;
|
||||
size_t length,i;
|
||||
|
||||
va_start(args,head_length);
|
||||
length=head_length;
|
||||
|
|
@ -907,7 +909,7 @@ static void print_res_top(MYSQL_RES *result)
|
|||
mysql_field_seek(result,0);
|
||||
while((field = mysql_fetch_field(result)))
|
||||
{
|
||||
if ((length=(uint) strlen(field->name)) > field->max_length)
|
||||
if ((length= strlen(field->name)) > field->max_length)
|
||||
field->max_length=length;
|
||||
else
|
||||
length=field->max_length;
|
||||
|
|
|
|||
|
|
@ -50,10 +50,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
|||
switch(optid) {
|
||||
case 'V':
|
||||
printf("%s version %s by Jani Tolonen\n", progname, VER);
|
||||
exit(-1);
|
||||
exit(0);
|
||||
case 'I':
|
||||
case '?':
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -69,7 +70,10 @@ int main(int argc, char *argv[])
|
|||
exit(-1);
|
||||
if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 ||
|
||||
(t= atoi(argv[1])) <= 0)
|
||||
{
|
||||
usage();
|
||||
exit(-1);
|
||||
}
|
||||
for (; t > 0; t--)
|
||||
{
|
||||
if (kill((pid_t) pid, sig))
|
||||
|
|
@ -100,5 +104,4 @@ void usage(void)
|
|||
printf("integer arguments.\n\n");
|
||||
printf("Options:\n");
|
||||
my_print_help(my_long_options);
|
||||
exit(-1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2000-2007 MySQL AB
|
||||
Use is subject to license terms
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -76,3 +76,9 @@ INSTALL(DIRECTORY . DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Developm
|
|||
PATTERN CMakeFiles EXCLUDE
|
||||
PATTERN mysql EXCLUDE
|
||||
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
|
||||
|
||||
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/. DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development
|
||||
FILES_MATCHING PATTERN "*.h"
|
||||
PATTERN CMakeFiles EXCLUDE
|
||||
PATTERN mysql EXCLUDE
|
||||
REGEX "\\./(${EXCL_RE}$)" EXCLUDE)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -331,7 +331,8 @@ typedef struct st_sort_info
|
|||
my_off_t filelength, dupp, buff_length;
|
||||
ha_rows max_records;
|
||||
uint current_key, total_keys;
|
||||
uint got_error, threads_running;
|
||||
volatile uint got_error;
|
||||
uint threads_running;
|
||||
myf myf_rw;
|
||||
enum data_file_type new_data_file_type;
|
||||
} MI_SORT_INFO;
|
||||
|
|
|
|||
|
|
@ -118,8 +118,12 @@ ADD_DEPENDENCIES(sql_embedded GenError GenServerSource)
|
|||
# On Unix, it is libmysqld.a
|
||||
IF(WIN32)
|
||||
SET(MYSQLSERVER_OUTPUT_NAME mysqlserver)
|
||||
SET(COMPONENT_MYSQLSERVER "Embedded")
|
||||
SET(COMPONENT_LIBMYSQLD "Embedded")
|
||||
ELSE()
|
||||
SET(MYSQLSERVER_OUTPUT_NAME mysqld)
|
||||
SET(COMPONENT_MYSQLSERVER "Development")
|
||||
SET(COMPONENT_LIBMYSQLD "Server")
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
|
@ -144,9 +148,9 @@ FOREACH(LIB ${LIBS})
|
|||
ENDFOREACH()
|
||||
|
||||
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
|
||||
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Development)
|
||||
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT ${COMPONENT_MYSQLSERVER})
|
||||
|
||||
INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT Development)
|
||||
INSTALL(FILES embedded_priv.h DESTINATION ${INSTALL_INCLUDEDIR}/private COMPONENT ${COMPONENT_MYSQLSERVER})
|
||||
|
||||
# Visual Studio users need debug static library
|
||||
IF(MSVC)
|
||||
|
|
@ -173,7 +177,7 @@ ENDFOREACH()
|
|||
|
||||
IF(NOT DISABLE_SHARED)
|
||||
MERGE_LIBRARIES(libmysqld SHARED mysqlserver EXPORTS ${EMBEDDED_API}
|
||||
COMPONENT Server)
|
||||
COMPONENT ${COMPONENT_LIBMYSQLD})
|
||||
IF(UNIX)
|
||||
# Name the shared library, handle versioning (provides same api as client
|
||||
# library hence the same version)
|
||||
|
|
|
|||
|
|
@ -1807,9 +1807,12 @@ sub set_build_thread_ports($) {
|
|||
if ( lc($opt_build_thread) eq 'auto' ) {
|
||||
my $found_free = 0;
|
||||
$build_thread = 300; # Start attempts from here
|
||||
my $build_thread_upper = $build_thread + ($opt_parallel > 1500
|
||||
? 3000
|
||||
: 2 * $opt_parallel) + 300;
|
||||
while (! $found_free)
|
||||
{
|
||||
$build_thread= mtr_get_unique_id($build_thread, 349);
|
||||
$build_thread= mtr_get_unique_id($build_thread, $build_thread_upper);
|
||||
if ( !defined $build_thread ) {
|
||||
mtr_error("Could not get a unique build thread id");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,9 +277,40 @@ CREATE TABLE t1 ( a VARCHAR(1) );
|
|||
INSERT INTO t1 VALUES ('m'),('n');
|
||||
CREATE VIEW v1 AS SELECT 'w' ;
|
||||
SELECT * FROM t1 WHERE a < ALL ( SELECT * FROM v1 );
|
||||
ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<='
|
||||
a
|
||||
m
|
||||
n
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
SET character_set_connection = default;
|
||||
SET optimizer_switch= default;
|
||||
#End of 5.3 tests
|
||||
#
|
||||
# Start of 5.5 tests
|
||||
#
|
||||
#
|
||||
# MDEV-10181 Illegal mix of collation for a field and an ASCII string as a view field
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
INSERT INTO t1 VALUES ('A'),('a'),('B'),('b');
|
||||
CREATE VIEW v1 AS SELECT 'a';
|
||||
SELECT * FROM v1,t1 where t1.a=v1.a;
|
||||
a a
|
||||
a A
|
||||
a a
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
INSERT INTO t1 VALUES ('a'),('b'),('c');
|
||||
CREATE VIEW v1 AS SELECT 'a' AS a UNION SELECT 'b';
|
||||
SELECT * FROM v1,t1 WHERE t1.a=v1.a;
|
||||
a a
|
||||
a a
|
||||
b b
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
|
|
|
|||
|
|
@ -6108,6 +6108,45 @@ OCTET_LENGTH(a) a
|
|||
255 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
|
||||
#
|
||||
#
|
||||
SET NAMES utf8;
|
||||
SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data;
|
||||
data
|
||||
131072
|
||||
SELECT length(data) AS len FROM (
|
||||
SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data
|
||||
) AS sub;
|
||||
len
|
||||
131072
|
||||
SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data;
|
||||
data
|
||||
131070
|
||||
SELECT length(data) AS len FROM (
|
||||
SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data
|
||||
) AS sub;
|
||||
len
|
||||
131070
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub;
|
||||
len
|
||||
73532
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub;
|
||||
len
|
||||
73534
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub;
|
||||
len
|
||||
73556
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
|
||||
len
|
||||
131070
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
|
||||
len
|
||||
131072
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
|
||||
len
|
||||
131074
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
|
|
|
|||
|
|
@ -2825,6 +2825,40 @@ OCTET_LENGTH(a) a
|
|||
252 😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎😎
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
|
||||
#
|
||||
#
|
||||
SET NAMES utf8mb4;
|
||||
SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data;
|
||||
data
|
||||
65532
|
||||
SELECT length(data) AS len
|
||||
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub;
|
||||
len
|
||||
65532
|
||||
SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data;
|
||||
data
|
||||
65538
|
||||
SELECT length(data) AS len
|
||||
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub;
|
||||
len
|
||||
65538
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub;
|
||||
len
|
||||
65532
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub;
|
||||
len
|
||||
65535
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
|
||||
len
|
||||
65538
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
|
||||
len
|
||||
196605
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
|
||||
len
|
||||
196608
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
#
|
||||
|
|
|
|||
|
|
@ -28,3 +28,18 @@ ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`
|
|||
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
|
||||
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
|
||||
DROP TABLE t2, t1;
|
||||
#
|
||||
# BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
|
||||
# KEY CONSTRAINT
|
||||
CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
|
||||
CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
|
||||
CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
|
||||
# Without patch, reports incorrect error.
|
||||
INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
|
||||
REPLACE INTO t2 VALUES('abc', 2);
|
||||
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
|
||||
INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
|
||||
Warnings:
|
||||
Warning 1452 Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk` FOREIGN KEY (`fld2`) REFERENCES `t1` (`fld1`))
|
||||
DROP TABLE t2, t1;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,34 @@ SELECT monthname('2001-03-01');
|
|||
monthname('2001-03-01')
|
||||
März
|
||||
#
|
||||
# MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field
|
||||
#
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
|
||||
INSERT INTO t1 VALUES ('test',now());
|
||||
Warnings:
|
||||
Note 1265 Data truncated for column 'd' at row 1
|
||||
SET lc_time_names=ru_RU;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
ERROR HY000: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'
|
||||
SET lc_time_names=en_US;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
c
|
||||
test
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
c
|
||||
test
|
||||
SET NAMES latin1;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
c
|
||||
test
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
c
|
||||
test
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Start of 5.6 tests
|
||||
#
|
||||
#
|
||||
|
|
|
|||
|
|
@ -376,6 +376,11 @@ Repairing views
|
|||
test.v1 OK
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table `#mysql50#t1``1` (a int) engine=myisam;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
t1`1
|
||||
drop table `t1``1`;
|
||||
#
|
||||
#MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
|
||||
#
|
||||
|
|
|
|||
|
|
@ -643,3 +643,23 @@ CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
|
|||
SET default_storage_engine = NEW.INNODB;
|
||||
ERROR 42S22: Unknown column 'INNODB' in 'NEW'
|
||||
DROP TABLE t1;
|
||||
select 0==0;
|
||||
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 '=0' at line 1
|
||||
select 1=!0, 1 = ! 0;
|
||||
1=!0 1 = ! 0
|
||||
1 1
|
||||
select !!0, ! ! 0;
|
||||
!!0 ! ! 0
|
||||
0 0
|
||||
select 2>!0, 2 > ! 0;
|
||||
2>!0 2 > ! 0
|
||||
1 1
|
||||
select 0<=!0, 0 <= !0;
|
||||
0<=!0 0 <= !0
|
||||
1 1
|
||||
select 1<<!0, 1 << !0;
|
||||
1<<!0 1 << !0
|
||||
2 2
|
||||
select 0<!0, 0 < ! 0;
|
||||
0<!0 0 < ! 0
|
||||
1 1
|
||||
|
|
|
|||
24
mysql-test/r/ssl_ca.result
Normal file
24
mysql-test/r/ssl_ca.result
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#
|
||||
# Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
|
||||
#
|
||||
# try to connect with wrong '--ssl-ca' path : should fail
|
||||
ERROR 2026 (HY000): SSL connection error: SSL_CTX_set_default_verify_paths failed
|
||||
# try to connect with correct '--ssl-ca' path : should connect
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
#
|
||||
# Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
|
||||
# PATH SUBSTITUTION
|
||||
#
|
||||
# try to connect with '--ssl-ca' option using tilde home directoy
|
||||
# path substitution : should connect
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
# try to connect with '--ssl-key' option using tilde home directoy
|
||||
# path substitution : should connect
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
# try to connect with '--ssl-cert' option using tilde home directoy
|
||||
# path substitution : should connect
|
||||
Variable_name Value
|
||||
Ssl_cipher DHE-RSA-AES256-SHA
|
||||
|
|
@ -440,6 +440,7 @@ select 1 from t1 as t1_0 inner join t1 as t2 on (t1_0.a <=> now()) join t1 on 1;
|
|||
drop table t1;
|
||||
#
|
||||
# MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null
|
||||
# MDEV-9972 Least function retuns date in date time format
|
||||
#
|
||||
CREATE TABLE t1 (
|
||||
id BIGINT NOT NULL,
|
||||
|
|
@ -463,9 +464,9 @@ LEAST(IFNULL(t2.date_fin, IFNULL(t1.date_fin, NULL)),
|
|||
IFNULL(t1.date_fin, IFNULL(t2.date_fin, NULL))) AS date_fin
|
||||
FROM t1 LEFT JOIN t2 ON (t1.id=t2.id);
|
||||
id date_debut date_fin
|
||||
1 2016-01-01 2016-01-31 00:00:00
|
||||
2 2016-02-01 2016-01-28 00:00:00
|
||||
3 2016-03-01 2016-03-31 00:00:00
|
||||
1 2016-01-01 2016-01-31
|
||||
2 2016-02-01 2016-01-28
|
||||
3 2016-03-01 2016-03-31
|
||||
4 2016-04-01 NULL
|
||||
DROP TABLE t1,t2;
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -1,82 +1,48 @@
|
|||
set names utf8;
|
||||
CREATE TABLE corrupt_bit_test_ā(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b CHAR(100),
|
||||
c INT,
|
||||
z INT,
|
||||
INDEX(b))
|
||||
ENGINE=InnoDB;
|
||||
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
|
||||
CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
|
||||
CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
|
||||
SELECT * FROM corrupt_bit_test_ā;
|
||||
a b c z
|
||||
1 x 1 1
|
||||
select @@unique_checks;
|
||||
@@unique_checks
|
||||
0
|
||||
select @@innodb_change_buffering_debug;
|
||||
@@innodb_change_buffering_debug
|
||||
1
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
|
||||
select count(*) from corrupt_bit_test_ā;
|
||||
count(*)
|
||||
1024
|
||||
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
|
||||
INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
|
||||
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
|
||||
check table corrupt_bit_test_ā;
|
||||
2
|
||||
Table Op Msg_type Msg_text
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxā" is corrupted.
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: The B-tree of index "idxē" is corrupted.
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
|
||||
test.corrupt_bit_test_ā check error Corrupt
|
||||
select c from corrupt_bit_test_ā;
|
||||
ERROR HY000: Index "idx" is corrupted
|
||||
ERROR HY000: Index "idx" is corrupted
|
||||
ERROR HY000: Index corrupt_bit_test_ā is corrupted
|
||||
select z from corrupt_bit_test_ā;
|
||||
ERROR HY000: Index corrupt_bit_test_ā is corrupted
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning 180 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
|
||||
Error 1712 Index corrupt_bit_test_ā is corrupted
|
||||
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
|
||||
select * from corrupt_bit_test_ā use index(primary) where a = 10001;
|
||||
a b c z
|
||||
10001 a 20001 20001
|
||||
begin;
|
||||
insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
|
||||
delete from corrupt_bit_test_ā where a = 10001;
|
||||
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
|
||||
rollback;
|
||||
drop index idxā on corrupt_bit_test_ā;
|
||||
check table corrupt_bit_test_ā;
|
||||
Table Op Msg_type Msg_text
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
|
||||
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
|
||||
test.corrupt_bit_test_ā check error Corrupt
|
||||
set names utf8;
|
||||
select z from corrupt_bit_test_ā;
|
||||
ERROR HY000: Index corrupt_bit_test_ā is corrupted
|
||||
drop index idxē on corrupt_bit_test_ā;
|
||||
select z from corrupt_bit_test_ā limit 10;
|
||||
Table Create Table
|
||||
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
|
||||
`a` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`b` char(100) DEFAULT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
`z` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`),
|
||||
UNIQUE KEY `idxē` (`z`,`b`),
|
||||
KEY `idx` (`b`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
|
||||
ERROR HY000: Index "idx" is corrupted
|
||||
ERROR HY000: Index "idx" is corrupted
|
||||
Table Create Table
|
||||
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
|
||||
`a` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`b` char(100) DEFAULT NULL,
|
||||
`c` int(11) DEFAULT NULL,
|
||||
`z` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`a`),
|
||||
KEY `idx` (`b`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
|
||||
z
|
||||
20001
|
||||
1
|
||||
1
|
||||
2
|
||||
11
|
||||
12
|
||||
21
|
||||
22
|
||||
31
|
||||
32
|
||||
drop table corrupt_bit_test_ā;
|
||||
DROP DATABASE pad;
|
||||
SET GLOBAL innodb_change_buffering_debug = 0;
|
||||
|
|
|
|||
|
|
@ -2,46 +2,24 @@
|
|||
# Test for persistent corrupt bit for corrupted index and table
|
||||
#
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/have_innodb_16k.inc
|
||||
|
||||
# Issues with innodb_change_buffering_debug on Windows, so the test scenario
|
||||
# cannot be created on windows
|
||||
--source include/not_windows.inc
|
||||
|
||||
#-- source include/have_innodb_16k.inc
|
||||
-- source include/not_embedded.inc
|
||||
# This test needs debug server
|
||||
--source include/have_debug.inc
|
||||
-- source include/have_debug.inc
|
||||
|
||||
-- disable_query_log
|
||||
call mtr.add_suppression("Flagged corruption of idx.*in CHECK TABLE");
|
||||
# This test setup is extracted from bug56680.test:
|
||||
# The flag innodb_change_buffering_debug is only available in debug builds.
|
||||
# It instructs InnoDB to try to evict pages from the buffer pool when
|
||||
# change buffering is possible, so that the change buffer will be used
|
||||
# whenever possible.
|
||||
SET @innodb_change_buffering_debug_orig = @@innodb_change_buffering_debug;
|
||||
SET GLOBAL innodb_change_buffering_debug = 1;
|
||||
|
||||
# Turn off Unique Check to create corrupted index with dup key
|
||||
SET UNIQUE_CHECKS=0;
|
||||
|
||||
CREATE DATABASE pad;
|
||||
let $i=338;
|
||||
while ($i)
|
||||
{
|
||||
--eval CREATE TABLE pad.t$i(a INT PRIMARY KEY)ENGINE=InnoDB;
|
||||
dec $i;
|
||||
}
|
||||
|
||||
-- enable_query_log
|
||||
call mtr.add_suppression("Flagged corruption of idx.*in");
|
||||
|
||||
set names utf8;
|
||||
|
||||
SET UNIQUE_CHECKS=0;
|
||||
|
||||
CREATE TABLE corrupt_bit_test_ā(
|
||||
a INT AUTO_INCREMENT PRIMARY KEY,
|
||||
b CHAR(100),
|
||||
c INT,
|
||||
z INT,
|
||||
INDEX(b))
|
||||
INDEX idx(b))
|
||||
ENGINE=InnoDB;
|
||||
|
||||
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
|
||||
|
|
@ -54,37 +32,20 @@ CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
|
|||
|
||||
SELECT * FROM corrupt_bit_test_ā;
|
||||
|
||||
select @@unique_checks;
|
||||
select @@innodb_change_buffering_debug;
|
||||
|
||||
# Create enough rows for the table, so that the insert buffer will be
|
||||
# used for modifying the secondary index page. There must be multiple
|
||||
# index pages, because changes to the root page are never buffered.
|
||||
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+10,z+10 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+20,z+20 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+50,z+50 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+100,z+100 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+200,z+200 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+400,z+400 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+800,z+800 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1600,z+1600 FROM corrupt_bit_test_ā;
|
||||
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+4000,z+4000 FROM corrupt_bit_test_ā;
|
||||
|
||||
select count(*) from corrupt_bit_test_ā;
|
||||
|
||||
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
|
||||
|
||||
# Create a dup key error on index "idxē" and "idxā" by inserting a dup value
|
||||
INSERT INTO corrupt_bit_test_ā VALUES(13000,'x',1,1);
|
||||
|
||||
# creating an index should succeed even if other secondary indexes are corrupted
|
||||
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
|
||||
|
||||
# Check table will find the unique indexes corrupted
|
||||
# with dup key
|
||||
# This will flag all secondary indexes corrupted
|
||||
SET SESSION debug_dbug="+d,dict_set_index_corrupted";
|
||||
check table corrupt_bit_test_ā;
|
||||
SET SESSION debug_dbug="";
|
||||
|
||||
# Cannot create new indexes while corrupted indexes exist
|
||||
--error ER_INDEX_CORRUPT
|
||||
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
|
||||
--error ER_INDEX_CORRUPT
|
||||
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
|
||||
|
||||
# This selection intend to use the corrupted index. Expect to fail
|
||||
-- error ER_INDEX_CORRUPT
|
||||
|
|
@ -109,7 +70,6 @@ delete from corrupt_bit_test_ā where a = 10001;
|
|||
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
|
||||
rollback;
|
||||
|
||||
# Drop one corrupted index before reboot
|
||||
drop index idxā on corrupt_bit_test_ā;
|
||||
|
||||
check table corrupt_bit_test_ā;
|
||||
|
|
@ -119,14 +79,26 @@ set names utf8;
|
|||
-- error ER_INDEX_CORRUPT
|
||||
select z from corrupt_bit_test_ā;
|
||||
|
||||
show create table corrupt_bit_test_ā;
|
||||
|
||||
# Drop the corrupted index
|
||||
drop index idxē on corrupt_bit_test_ā;
|
||||
|
||||
# Cannot create new indexes while a corrupt index exists.
|
||||
--error ER_INDEX_CORRUPT
|
||||
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
|
||||
--error ER_INDEX_CORRUPT
|
||||
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
|
||||
|
||||
show create table corrupt_bit_test_ā;
|
||||
drop index idx on corrupt_bit_test_ā;
|
||||
|
||||
# Now that there exist no corrupted indexes, we can create new indexes.
|
||||
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
|
||||
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
|
||||
|
||||
# Now select back to normal
|
||||
select z from corrupt_bit_test_ā limit 10;
|
||||
|
||||
# Drop table
|
||||
drop table corrupt_bit_test_ā;
|
||||
DROP DATABASE pad;
|
||||
|
||||
SET GLOBAL innodb_change_buffering_debug = 0;
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARN
|
|||
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
|
||||
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
|
||||
NULL NULL NULL 55 32 1 2
|
||||
statements_digest b12e7d0f2ac88c8fad9ac8dabb347b09 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
|
||||
statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
|
||||
SHOW VARIABLES LIKE "performance_schema_digests_size";
|
||||
Variable_name Value
|
||||
performance_schema_digests_size 2
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ select digest, digest_text, count_star
|
|||
from performance_schema.events_statements_summary_by_digest
|
||||
where digest_text like "%in_%_digest%";
|
||||
digest digest_text count_star
|
||||
1281ed1e23aaa2e5528e90ebf98cfbdd SELECT ? AS `in_master_digest` 1
|
||||
d4c0df8aac0e1b575629aad4534b5c7b SELECT ? AS `in_master_digest` 1
|
||||
insert into test.marker values (2);
|
||||
**** On Slave ****
|
||||
select * from test.marker;
|
||||
|
|
@ -64,7 +64,7 @@ select digest, digest_text, count_star
|
|||
from performance_schema.events_statements_summary_by_digest
|
||||
where digest_text like "%in_%_digest%";
|
||||
digest digest_text count_star
|
||||
e0d84aed3bfac675887b38c4902f057f SELECT ? AS `in_slave_digest` 1
|
||||
aa6b10b84ad0f249ef4fcece8da6dd77 SELECT ? AS `in_slave_digest` 1
|
||||
**** On Master ****
|
||||
delete from performance_schema.setup_objects
|
||||
where object_schema='master';
|
||||
|
|
|
|||
|
|
@ -67,3 +67,4 @@ Performance_schema_table_instances_lost 0
|
|||
Performance_schema_thread_classes_lost 0
|
||||
Performance_schema_thread_instances_lost 0
|
||||
Performance_schema_users_lost 0
|
||||
CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
|
|||
####################################
|
||||
SELECT event_name, digest, digest_text, sql_text FROM events_statements_history_long;
|
||||
event_name digest digest_text sql_text
|
||||
statement/sql/truncate e1c917a43f978456fab15240f89372ca TRUNCATE TABLE truncate table events_statements_history_long
|
||||
statement/sql/select 4cc1c447d79877c4e8df0423fd0cde9a SELECT ? + ? + SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
|
||||
statement/sql/truncate c4afa12dd9165da1a5fe8b74cf43005d TRUNCATE TABLE truncate table events_statements_history_long
|
||||
statement/sql/select 719c3d02e550844d831d96809f405c39 SELECT ? + ? + SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
|
||||
|
|
|
|||
|
|
@ -112,41 +112,41 @@ DROP TRIGGER trg;
|
|||
SELECT SCHEMA_NAME, DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
|
||||
SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
|
||||
SCHEMA_NAME DIGEST DIGEST_TEXT COUNT_STAR SUM_ROWS_AFFECTED SUM_WARNINGS SUM_ERRORS
|
||||
statements_digest b12e7d0f2ac88c8fad9ac8dabb347b09 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
|
||||
statements_digest 390f3ff3444c4de44fcbd052b11caf4e SELECT ? FROM `t1` 2 0 0 0
|
||||
statements_digest 8726524372f6e4924bbe1393b772498e SELECT ?, ... FROM `t1` 2 0 0 0
|
||||
statements_digest 5b06fb13fa9af5e8a4ec26bac8f994cd SELECT ? FROM `t2` 1 0 0 0
|
||||
statements_digest 82201946968b4baca616292f96e933a7 SELECT ?, ... FROM `t2` 2 0 0 0
|
||||
statements_digest 35d365779571257e8837f01b39dd9df5 INSERT INTO `t1` VALUES (?) 2 2 0 0
|
||||
statements_digest eaaf6c26e98130ec21cfae1389e3eb94 INSERT INTO `t2` VALUES (?) 1 1 0 0
|
||||
statements_digest 28f3cfdcfffeff3219bdd255ed15e6ac INSERT INTO `t3` VALUES (...) 4 4 0 0
|
||||
statements_digest 166a9591b81371a6ea389f27cfc1e5fd INSERT INTO `t4` VALUES (...) 1 1 0 0
|
||||
statements_digest fb25b9f9146120fb72c3c732e79dcc82 INSERT INTO `t5` VALUES (...) 1 1 0 0
|
||||
statements_digest 58bb7798d974224ff08742502eed1aae INSERT INTO `t1` VALUES (?) /* , ... */ 2 7 0 0
|
||||
statements_digest 3352b44dcaf21f59141ea76b5cace5c0 INSERT INTO `t3` VALUES (...) /* , ... */ 1 3 0 0
|
||||
statements_digest 1905c012e5d6a3a12e39b0b3ce13b22a INSERT INTO `t5` VALUES (...) /* , ... */ 1 3 0 0
|
||||
statements_digest 981d682c1e63b437c33230eb558d0f64 INSERT INTO `t6` VALUES (...) 5 5 0 0
|
||||
statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 0 0 0
|
||||
statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 0 0 0
|
||||
statements_digest 6382c1dfc79755af2dd46113acea142b CREATE SCHEMA `statements_digest_temp` 2 2 0 0
|
||||
statements_digest 256f8dfc97d90a79103ebd6616b8d7aa DROP SCHEMA `statements_digest_temp` 2 0 0 0
|
||||
statements_digest 5315d33e7ef87b104b73912d484af6a3 SELECT ? FROM `no_such_table` 1 0 0 1
|
||||
statements_digest dcde8f720a419aa5d52246207268cf6c CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2 0 0 1
|
||||
statements_digest b4b4abab3f030642444fb32c44f28058 DROP TABLE `dup_table` 1 0 0 0
|
||||
statements_digest a34ed519fdeb4fe4460038db92ea0c20 INSERT INTO `t11` VALUES (?) 1 1 1 0
|
||||
statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 0 0 0
|
||||
statements_digest e6aa634cf5a630087fefe9868b018329 PREPARE `stmt` FROM ? 1 0 0 0
|
||||
statements_digest 4de34527c0dfef6ad8387d4359f78c78 EXECUTE `stmt` 2 0 0 0
|
||||
statements_digest 54592849b6cf7386568c88e7fb20f61e DEALLOCATE PREPARE `stmt` 1 0 0 0
|
||||
statements_digest ee90db91a06cedfbcccf80f951dc58cd CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1 0 0 0
|
||||
statements_digest f964655a0037d2f194030bd024eab748 CALL `p1` ( ) 2 0 0 0
|
||||
statements_digest 788d8223f67ba10d1b97fcaa42fec081 DROP PROCEDURE `p1` 1 0 0 0
|
||||
statements_digest 5146273ef7d98ee1954d23fd98a35d68 CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1 0 0 0
|
||||
statements_digest 2c9b8e1e7f2ad3ca3c49abb2ea30e871 SELECT `func` (...) 2 0 0 0
|
||||
statements_digest f48e30910f8e7758b818c088916424cd DROP FUNCTION `func` 1 0 0 0
|
||||
statements_digest 53ccf1d241eeb749f1e1b7becc65006f CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1 0 0 0
|
||||
statements_digest a9722a0717a57275431575c7204d71c1 INSERT INTO `t12` VALUES (?) 2 2 0 0
|
||||
statements_digest 2d48809e6899f63ec304776466a63eef DROP TRIGGER `trg` 1 0 0 0
|
||||
statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
|
||||
statements_digest a76073841b59a83de0fcdb6a0158b94a SELECT ? FROM `t1` 2 0 0 0
|
||||
statements_digest d91813c4d7a128822624a55b43bab7b2 SELECT ?, ... FROM `t1` 2 0 0 0
|
||||
statements_digest 8d1d0319e2ce41e1c41455a06b8905f8 SELECT ? FROM `t2` 1 0 0 0
|
||||
statements_digest 704f1e85525022d18028b3493bf61e65 SELECT ?, ... FROM `t2` 2 0 0 0
|
||||
statements_digest 7f60599ab03830f5571b306d71e47ba3 INSERT INTO `t1` VALUES (?) 2 2 0 0
|
||||
statements_digest 103d388f122df6a6a2c9f7fa01d90d7d INSERT INTO `t2` VALUES (?) 1 1 0 0
|
||||
statements_digest f1f56fda9303c1e2555bd67d431398ab INSERT INTO `t3` VALUES (...) 4 4 0 0
|
||||
statements_digest 08fc8813613c3cd44736a4abbb0cd095 INSERT INTO `t4` VALUES (...) 1 1 0 0
|
||||
statements_digest ab209b79451b94d03d8e20374ec18795 INSERT INTO `t5` VALUES (...) 1 1 0 0
|
||||
statements_digest 4729eb58cad3b77435bcd17864cfe322 INSERT INTO `t1` VALUES (?) /* , ... */ 2 7 0 0
|
||||
statements_digest 8e543c7785feeeb3e9a1957397a1033f INSERT INTO `t3` VALUES (...) /* , ... */ 1 3 0 0
|
||||
statements_digest 3dd587a1c42991bb323cbaa4c6fb61d0 INSERT INTO `t5` VALUES (...) /* , ... */ 1 3 0 0
|
||||
statements_digest 6f2f9f471f739d16b4ff4faf256e839e INSERT INTO `t6` VALUES (...) 5 5 0 0
|
||||
statements_digest 9701bfa1fb64563334f1a52953e065f3 SELECT ? + ? 3 0 0 0
|
||||
statements_digest b0785a540ffc1743c4e0879d193a4b10 SELECT ? 1 0 0 0
|
||||
statements_digest bee0eebfc340dbd233ee8c86270ac6ea CREATE SCHEMA `statements_digest_temp` 2 2 0 0
|
||||
statements_digest a35fd3ac67e64b9ac41a53781a7f5662 DROP SCHEMA `statements_digest_temp` 2 0 0 0
|
||||
statements_digest 52ec0213cba551f38d069c94a50cd2c7 SELECT ? FROM `no_such_table` 1 0 0 1
|
||||
statements_digest 27d4298be49de7a7606fcc8122ce7cd6 CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2 0 0 1
|
||||
statements_digest 8a9b185842f12475c7ffa350ade45408 DROP TABLE `dup_table` 1 0 0 0
|
||||
statements_digest bda68c0a1eca7b625a5158da41ebbcf9 INSERT INTO `t11` VALUES (?) 1 1 1 0
|
||||
statements_digest 196c9f451360b5e24e03aa82f86006ae SHOW WARNINGS 1 0 0 0
|
||||
statements_digest 3413dd64a34c2148e669e3283ca41ff5 PREPARE `stmt` FROM ? 1 0 0 0
|
||||
statements_digest fcec9dcf45c26dabade2c7a4ab818543 EXECUTE `stmt` 2 0 0 0
|
||||
statements_digest 9e5e4f78f8226cc853fa1ce62ae61f9d DEALLOCATE PREPARE `stmt` 1 0 0 0
|
||||
statements_digest c92f30dceb52f470a6c36400bdb372c6 CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1 0 0 0
|
||||
statements_digest db338b4f4a13d74acda7a7b9dae2b0b4 CALL `p1` ( ) 2 0 0 0
|
||||
statements_digest c2c92e9e7ac73741622d1f264e08c384 DROP PROCEDURE `p1` 1 0 0 0
|
||||
statements_digest c99aad5579088b31cdd53be4bfbc2b6e CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1 0 0 0
|
||||
statements_digest 1f4ce8758787f5aa5f51f1ee7f3b8119 SELECT `func` (...) 2 0 0 0
|
||||
statements_digest ab76a0821015fa000a1df9c684072e37 DROP FUNCTION `func` 1 0 0 0
|
||||
statements_digest ce5db6554a357045978a5572c84a7655 CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1 0 0 0
|
||||
statements_digest 801f02819c67e56fe3f22cc7dda99707 INSERT INTO `t12` VALUES (?) 2 2 0 0
|
||||
statements_digest dc3b07fe8e4d5fa91b383605f18512b0 DROP TRIGGER `trg` 1 0 0 0
|
||||
####################################
|
||||
# CLEANUP
|
||||
####################################
|
||||
|
|
|
|||
|
|
@ -125,41 +125,41 @@ DROP TRIGGER trg;
|
|||
####################################
|
||||
SELECT schema_name, digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
|
||||
schema_name digest digest_text count_star
|
||||
statements_digest b12e7d0f2ac88c8fad9ac8dabb347b09 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
||||
statements_digest 390f3ff3444c4de44fcbd052b11caf4e SELECT ? FROM `t1` 2
|
||||
statements_digest 8726524372f6e4924bbe1393b772498e SELECT ?, ... FROM `t1` 2
|
||||
statements_digest 5b06fb13fa9af5e8a4ec26bac8f994cd SELECT ? FROM `t2` 1
|
||||
statements_digest 82201946968b4baca616292f96e933a7 SELECT ?, ... FROM `t2` 2
|
||||
statements_digest 35d365779571257e8837f01b39dd9df5 INSERT INTO `t1` VALUES (?) 2
|
||||
statements_digest eaaf6c26e98130ec21cfae1389e3eb94 INSERT INTO `t2` VALUES (?) 1
|
||||
statements_digest 28f3cfdcfffeff3219bdd255ed15e6ac INSERT INTO `t3` VALUES (...) 4
|
||||
statements_digest 166a9591b81371a6ea389f27cfc1e5fd INSERT INTO `t4` VALUES (...) 1
|
||||
statements_digest fb25b9f9146120fb72c3c732e79dcc82 INSERT INTO `t5` VALUES (...) 1
|
||||
statements_digest 58bb7798d974224ff08742502eed1aae INSERT INTO `t1` VALUES (?) /* , ... */ 2
|
||||
statements_digest 3352b44dcaf21f59141ea76b5cace5c0 INSERT INTO `t3` VALUES (...) /* , ... */ 1
|
||||
statements_digest 1905c012e5d6a3a12e39b0b3ce13b22a INSERT INTO `t5` VALUES (...) /* , ... */ 1
|
||||
statements_digest 981d682c1e63b437c33230eb558d0f64 INSERT INTO `t6` VALUES (...) 5
|
||||
statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3
|
||||
statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1
|
||||
statements_digest 6382c1dfc79755af2dd46113acea142b CREATE SCHEMA `statements_digest_temp` 2
|
||||
statements_digest 256f8dfc97d90a79103ebd6616b8d7aa DROP SCHEMA `statements_digest_temp` 2
|
||||
statements_digest 5315d33e7ef87b104b73912d484af6a3 SELECT ? FROM `no_such_table` 1
|
||||
statements_digest dcde8f720a419aa5d52246207268cf6c CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2
|
||||
statements_digest b4b4abab3f030642444fb32c44f28058 DROP TABLE `dup_table` 1
|
||||
statements_digest a34ed519fdeb4fe4460038db92ea0c20 INSERT INTO `t11` VALUES (?) 1
|
||||
statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1
|
||||
statements_digest e6aa634cf5a630087fefe9868b018329 PREPARE `stmt` FROM ? 1
|
||||
statements_digest 4de34527c0dfef6ad8387d4359f78c78 EXECUTE `stmt` 2
|
||||
statements_digest 54592849b6cf7386568c88e7fb20f61e DEALLOCATE PREPARE `stmt` 1
|
||||
statements_digest ee90db91a06cedfbcccf80f951dc58cd CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1
|
||||
statements_digest f964655a0037d2f194030bd024eab748 CALL `p1` ( ) 2
|
||||
statements_digest 788d8223f67ba10d1b97fcaa42fec081 DROP PROCEDURE `p1` 1
|
||||
statements_digest 5146273ef7d98ee1954d23fd98a35d68 CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1
|
||||
statements_digest 2c9b8e1e7f2ad3ca3c49abb2ea30e871 SELECT `func` (...) 2
|
||||
statements_digest f48e30910f8e7758b818c088916424cd DROP FUNCTION `func` 1
|
||||
statements_digest 53ccf1d241eeb749f1e1b7becc65006f CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1
|
||||
statements_digest a9722a0717a57275431575c7204d71c1 INSERT INTO `t12` VALUES (?) 2
|
||||
statements_digest 2d48809e6899f63ec304776466a63eef DROP TRIGGER `trg` 1
|
||||
statements_digest 52e3729216b72a67a671ac3b93a1f1d3 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
|
||||
statements_digest a76073841b59a83de0fcdb6a0158b94a SELECT ? FROM `t1` 2
|
||||
statements_digest d91813c4d7a128822624a55b43bab7b2 SELECT ?, ... FROM `t1` 2
|
||||
statements_digest 8d1d0319e2ce41e1c41455a06b8905f8 SELECT ? FROM `t2` 1
|
||||
statements_digest 704f1e85525022d18028b3493bf61e65 SELECT ?, ... FROM `t2` 2
|
||||
statements_digest 7f60599ab03830f5571b306d71e47ba3 INSERT INTO `t1` VALUES (?) 2
|
||||
statements_digest 103d388f122df6a6a2c9f7fa01d90d7d INSERT INTO `t2` VALUES (?) 1
|
||||
statements_digest f1f56fda9303c1e2555bd67d431398ab INSERT INTO `t3` VALUES (...) 4
|
||||
statements_digest 08fc8813613c3cd44736a4abbb0cd095 INSERT INTO `t4` VALUES (...) 1
|
||||
statements_digest ab209b79451b94d03d8e20374ec18795 INSERT INTO `t5` VALUES (...) 1
|
||||
statements_digest 4729eb58cad3b77435bcd17864cfe322 INSERT INTO `t1` VALUES (?) /* , ... */ 2
|
||||
statements_digest 8e543c7785feeeb3e9a1957397a1033f INSERT INTO `t3` VALUES (...) /* , ... */ 1
|
||||
statements_digest 3dd587a1c42991bb323cbaa4c6fb61d0 INSERT INTO `t5` VALUES (...) /* , ... */ 1
|
||||
statements_digest 6f2f9f471f739d16b4ff4faf256e839e INSERT INTO `t6` VALUES (...) 5
|
||||
statements_digest 9701bfa1fb64563334f1a52953e065f3 SELECT ? + ? 3
|
||||
statements_digest b0785a540ffc1743c4e0879d193a4b10 SELECT ? 1
|
||||
statements_digest bee0eebfc340dbd233ee8c86270ac6ea CREATE SCHEMA `statements_digest_temp` 2
|
||||
statements_digest a35fd3ac67e64b9ac41a53781a7f5662 DROP SCHEMA `statements_digest_temp` 2
|
||||
statements_digest 52ec0213cba551f38d069c94a50cd2c7 SELECT ? FROM `no_such_table` 1
|
||||
statements_digest 27d4298be49de7a7606fcc8122ce7cd6 CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2
|
||||
statements_digest 8a9b185842f12475c7ffa350ade45408 DROP TABLE `dup_table` 1
|
||||
statements_digest bda68c0a1eca7b625a5158da41ebbcf9 INSERT INTO `t11` VALUES (?) 1
|
||||
statements_digest 196c9f451360b5e24e03aa82f86006ae SHOW WARNINGS 1
|
||||
statements_digest 3413dd64a34c2148e669e3283ca41ff5 PREPARE `stmt` FROM ? 1
|
||||
statements_digest fcec9dcf45c26dabade2c7a4ab818543 EXECUTE `stmt` 2
|
||||
statements_digest 9e5e4f78f8226cc853fa1ce62ae61f9d DEALLOCATE PREPARE `stmt` 1
|
||||
statements_digest c92f30dceb52f470a6c36400bdb372c6 CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1
|
||||
statements_digest db338b4f4a13d74acda7a7b9dae2b0b4 CALL `p1` ( ) 2
|
||||
statements_digest c2c92e9e7ac73741622d1f264e08c384 DROP PROCEDURE `p1` 1
|
||||
statements_digest c99aad5579088b31cdd53be4bfbc2b6e CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1
|
||||
statements_digest 1f4ce8758787f5aa5f51f1ee7f3b8119 SELECT `func` (...) 2
|
||||
statements_digest ab76a0821015fa000a1df9c684072e37 DROP FUNCTION `func` 1
|
||||
statements_digest ce5db6554a357045978a5572c84a7655 CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1
|
||||
statements_digest 801f02819c67e56fe3f22cc7dda99707 INSERT INTO `t12` VALUES (?) 2
|
||||
statements_digest dc3b07fe8e4d5fa91b383605f18512b0 DROP TRIGGER `trg` 1
|
||||
SELECT digest, digest_text FROM performance_schema.events_statements_current;
|
||||
digest digest_text
|
||||
####################################
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
|
|||
####################################
|
||||
SELECT schema_name, digest, digest_text, count_star FROM events_statements_summary_by_digest;
|
||||
schema_name digest digest_text count_star
|
||||
performance_schema b6650e3f746acc31ef465aede8087e93 TRUNCATE TABLE `events_statements_summary_by_digest` 1
|
||||
performance_schema 63f9aaeed7859671c6a42c75fcd43785 SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1
|
||||
performance_schema 2f6bc98e6ca82311b17aac2f1e7cd85d TRUNCATE TABLE `events_statements_summary_by_digest` 1
|
||||
performance_schema 6c4b347800e3aa6bd3e41e3b97b3828a SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? 1
|
||||
|
|
|
|||
156
mysql-test/suite/perfschema/r/table_name.result
Normal file
156
mysql-test/suite/perfschema/r/table_name.result
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
|
||||
#
|
||||
# TEST 1: Normal tables prefixed with "#sql" and "sql".
|
||||
#
|
||||
USE test;
|
||||
CREATE TABLE `#sql_1` (a int, b text);
|
||||
INSERT INTO `#sql_1` VALUES(1,'one');
|
||||
|
||||
CREATE TABLE `sql_1` (a int, b text);
|
||||
INSERT INTO `sql_1` VALUES(1,'one');
|
||||
|
||||
# Verify that the tables are treated as normal tables .
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
TABLE test #sql_1
|
||||
TABLE test sql_1
|
||||
|
||||
# Drop the tables, verify that the table objects are removed.
|
||||
|
||||
DROP TABLE `#sql_1`;
|
||||
DROP TABLE `sql_1`;
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
#
|
||||
# TEST 2: Temporary tables, no special prefix.
|
||||
#
|
||||
CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO sql_temp2_myisam VALUES(1,'one');
|
||||
|
||||
CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
|
||||
INSERT INTO sql_temp2_innodb VALUES(1,'one');
|
||||
|
||||
# Confirm that the temporary tables are ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
# Drop the tables, verify that the table objects are not created.
|
||||
|
||||
DROP TABLE sql_temp2_myisam;
|
||||
DROP TABLE sql_temp2_innodb;
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
#
|
||||
# TEST 3: Temporary tables with the "#sql" prefix.
|
||||
#
|
||||
CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
CHECK TABLE `#sql_temp3_myisam`;
|
||||
Table Op Msg_type Msg_text
|
||||
test.#sql_temp3_myisam check status OK
|
||||
INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
|
||||
|
||||
CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
|
||||
CHECK TABLE `#sql_temp3_innodb`;
|
||||
Table Op Msg_type Msg_text
|
||||
test.#sql_temp3_innodb check status OK
|
||||
INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
|
||||
|
||||
# Confirm that the temporary tables are ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
# Drop the temporary tables.
|
||||
|
||||
DROP TABLE `#sql_temp3_myisam`;
|
||||
DROP TABLE `#sql_temp3_innodb`;
|
||||
|
||||
# Confirm that the temporary tables are still ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
#
|
||||
# TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
|
||||
# when they are truncated.
|
||||
#
|
||||
CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
|
||||
|
||||
CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
|
||||
|
||||
# Confirm that the MyISAM temporary tables are ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
# Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
|
||||
|
||||
TRUNCATE TABLE `sql_temp4_myisam`;
|
||||
TRUNCATE TABLE `#sql_temp4_myisam`;
|
||||
|
||||
# Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
# Drop the recreated MyISAM tables;
|
||||
|
||||
DROP TABLE `sql_temp4_myisam`;
|
||||
DROP TABLE `#sql_temp4_myisam`;
|
||||
|
||||
# Confirm that the recreated temporary tables are still ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
#
|
||||
# TEST 5: Generate temporary tables with ALTER MyISAM table.
|
||||
#
|
||||
USE test;
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
ALTER TABLE t1 ADD COLUMN (b int);
|
||||
|
||||
# Confirm that the recreated temporary tables are still ignored.
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
||||
# Drop the MyISAM table
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
# Confirm that no tables remain;
|
||||
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
object_type object_schema object_name
|
||||
|
|
@ -7,3 +7,4 @@
|
|||
|
||||
--source ../include/sizing_auto.inc
|
||||
|
||||
CALL mtr.add_suppression("innodb_open_files should not be greater than the open_files_limit.");
|
||||
|
|
|
|||
165
mysql-test/suite/perfschema/t/table_name.test
Normal file
165
mysql-test/suite/perfschema/t/table_name.test
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
#
|
||||
# Performance Schema
|
||||
#
|
||||
# Verify that the Performance Schema correctly identifies normal and temporary
|
||||
# tables with non-standard names.
|
||||
|
||||
# The server uses the table name prefix "#sql" for temporary and intermediate
|
||||
# tables, however user-defined tables having the "#sql" prefix are also permitted.
|
||||
# Independent of the table name, temporary or intermediate tables always have the
|
||||
# "#sql" prefix in the filename. (For non-temporary tables starting with "#",
|
||||
# the "#" is encoded to @0023 in the filename.)
|
||||
#
|
||||
# Given the ambiguity with temporary table names, the Performance Schema identifies
|
||||
# temporary tables tables either by the table category or by the filename.
|
||||
#
|
||||
--source include/have_perfschema.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # TEST 1: Normal tables prefixed with "#sql" and "sql".
|
||||
--echo #
|
||||
USE test;
|
||||
CREATE TABLE `#sql_1` (a int, b text);
|
||||
# INSERT forces path through get_table_share()
|
||||
INSERT INTO `#sql_1` VALUES(1,'one');
|
||||
--echo
|
||||
CREATE TABLE `sql_1` (a int, b text);
|
||||
INSERT INTO `sql_1` VALUES(1,'one');
|
||||
--echo
|
||||
--echo # Verify that the tables are treated as normal tables .
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Drop the tables, verify that the table objects are removed.
|
||||
--echo
|
||||
DROP TABLE `#sql_1`;
|
||||
DROP TABLE `sql_1`;
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # TEST 2: Temporary tables, no special prefix.
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE sql_temp2_myisam (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO sql_temp2_myisam VALUES(1,'one');
|
||||
--echo
|
||||
CREATE TEMPORARY TABLE sql_temp2_innodb (a int, b text) ENGINE=INNODB;
|
||||
INSERT INTO sql_temp2_innodb VALUES(1,'one');
|
||||
--echo
|
||||
--echo # Confirm that the temporary tables are ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Drop the tables, verify that the table objects are not created.
|
||||
--echo
|
||||
DROP TABLE sql_temp2_myisam;
|
||||
DROP TABLE sql_temp2_innodb;
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # TEST 3: Temporary tables with the "#sql" prefix.
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE `#sql_temp3_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
CHECK TABLE `#sql_temp3_myisam`;
|
||||
INSERT INTO `#sql_temp3_myisam` VALUES(1,'one');
|
||||
--echo
|
||||
CREATE TEMPORARY TABLE `#sql_temp3_innodb` (a int, b text) ENGINE=INNODB;
|
||||
CHECK TABLE `#sql_temp3_innodb`;
|
||||
INSERT INTO `#sql_temp3_innodb` VALUES(1,'one');
|
||||
--echo
|
||||
--echo # Confirm that the temporary tables are ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Drop the temporary tables.
|
||||
--echo
|
||||
DROP TABLE `#sql_temp3_myisam`;
|
||||
DROP TABLE `#sql_temp3_innodb`;
|
||||
--echo
|
||||
--echo # Confirm that the temporary tables are still ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # TEST 4: Special case: MyISAM temporary tables are recreated as non-temporary
|
||||
--echo # when they are truncated.
|
||||
--echo #
|
||||
CREATE TEMPORARY TABLE `sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO `sql_temp4_myisam` VALUES(1,'one');
|
||||
--echo
|
||||
CREATE TEMPORARY TABLE `#sql_temp4_myisam` (a int, b text) ENGINE=MYISAM;
|
||||
INSERT INTO `#sql_temp4_myisam` VALUES(1,'one');
|
||||
--echo
|
||||
--echo # Confirm that the MyISAM temporary tables are ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Truncate the MyISAM temporary tables, forcing them to be recreated as non-temporary.
|
||||
--echo
|
||||
TRUNCATE TABLE `sql_temp4_myisam`;
|
||||
TRUNCATE TABLE `#sql_temp4_myisam`;
|
||||
--echo
|
||||
--echo # Confirm that the recreated MyISAM tables are still regarded as temporary and ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Drop the recreated MyISAM tables;
|
||||
--echo
|
||||
DROP TABLE `sql_temp4_myisam`;
|
||||
DROP TABLE `#sql_temp4_myisam`;
|
||||
--echo
|
||||
--echo # Confirm that the recreated temporary tables are still ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
|
||||
--echo
|
||||
--echo #
|
||||
--echo # TEST 5: Generate temporary tables with ALTER MyISAM table.
|
||||
--echo #
|
||||
USE test;
|
||||
CREATE TABLE t1 (a int) ENGINE=MYISAM;
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
# Force a path throug mysql_alter_table() and ha_create_table().
|
||||
ALTER TABLE t1 ADD COLUMN (b int);
|
||||
--echo
|
||||
--echo # Confirm that the recreated temporary tables are still ignored.
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
--echo
|
||||
--echo # Drop the MyISAM table
|
||||
--echo
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo
|
||||
--echo # Confirm that no tables remain;
|
||||
--echo
|
||||
SELECT object_type, object_schema, object_name
|
||||
FROM performance_schema.objects_summary_global_by_type
|
||||
WHERE object_schema="test";
|
||||
|
|
@ -165,7 +165,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123';
|
|||
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
|
||||
SET PASSWORD FOR u1 = PASSWORD('pwd 098');
|
||||
SET PASSWORD FOR u1=<secret>;
|
||||
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 '=<secret>' 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 '<secret>' at line 1
|
||||
CREATE USER u3 IDENTIFIED BY '';
|
||||
drop user u1, u2, u3;
|
||||
select 2;
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ CREATE USER u1 IDENTIFIED BY 'pwd-123';
|
|||
GRANT ALL ON sa_db TO u2 IDENTIFIED BY "pwd-321";
|
||||
SET PASSWORD FOR u1 = PASSWORD('pwd 098');
|
||||
SET PASSWORD FOR u1=<secret>;
|
||||
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 '=<secret>' 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 '<secret>' at line 1
|
||||
CREATE USER u3 IDENTIFIED BY '';
|
||||
drop user u1, u2, u3;
|
||||
select 2;
|
||||
|
|
|
|||
|
|
@ -142,4 +142,5 @@ HEX(word)
|
|||
SELECT * FROM tmptbl504451f4258$1;
|
||||
ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
|
||||
DROP TABLE t5;
|
||||
flush privileges;
|
||||
include/rpl_end.inc
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
source include/master-slave.inc;
|
||||
let collation=utf8_unicode_ci;
|
||||
--source include/have_collation.inc
|
||||
source include/have_collation.inc;
|
||||
source include/master-slave.inc;
|
||||
|
||||
call mtr.add_suppression("Can't find record in 't.'");
|
||||
call mtr.add_suppression("Can't find record in 'user'");
|
||||
|
|
@ -180,6 +180,7 @@ SELECT HEX(word) FROM t5;
|
|||
SELECT * FROM tmptbl504451f4258$1;
|
||||
connection master;
|
||||
DROP TABLE t5;
|
||||
flush privileges;
|
||||
sync_slave_with_master;
|
||||
|
||||
--source include/rpl_end.inc
|
||||
|
|
|
|||
|
|
@ -220,7 +220,6 @@ SET character_set_connection = utf8;
|
|||
CREATE TABLE t1 ( a VARCHAR(1) );
|
||||
INSERT INTO t1 VALUES ('m'),('n');
|
||||
CREATE VIEW v1 AS SELECT 'w' ;
|
||||
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||
SELECT * FROM t1 WHERE a < ALL ( SELECT * FROM v1 );
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
|
|
@ -228,3 +227,30 @@ SET character_set_connection = default;
|
|||
SET optimizer_switch= default;
|
||||
|
||||
--echo #End of 5.3 tests
|
||||
|
||||
--echo #
|
||||
--echo # Start of 5.5 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10181 Illegal mix of collation for a field and an ASCII string as a view field
|
||||
--echo #
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
INSERT INTO t1 VALUES ('A'),('a'),('B'),('b');
|
||||
CREATE VIEW v1 AS SELECT 'a';
|
||||
SELECT * FROM v1,t1 where t1.a=v1.a;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
|
||||
INSERT INTO t1 VALUES ('a'),('b'),('c');
|
||||
CREATE VIEW v1 AS SELECT 'a' AS a UNION SELECT 'b';
|
||||
SELECT * FROM v1,t1 WHERE t1.a=v1.a;
|
||||
DROP VIEW v1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -1677,6 +1677,29 @@ ALTER TABLE t1 MODIFY a TINYTEXT CHARACTER SET utf8;
|
|||
SELECT OCTET_LENGTH(a),a FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
|
||||
--echo #
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8;
|
||||
SELECT length(rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2)) AS data;
|
||||
SELECT length(data) AS len FROM (
|
||||
SELECT rpad(_utf8 0xD0B1, 65536, _utf8 0xD0B2) AS data
|
||||
) AS sub;
|
||||
|
||||
SELECT length(rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2)) AS data;
|
||||
SELECT length(data) AS len FROM (
|
||||
SELECT rpad(_utf8 0xD0B1, 65535, _utf8 0xD0B2) AS data
|
||||
) AS sub;
|
||||
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36766) AS data) AS sub;
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36767) AS data) AS sub;
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 36778) AS data) AS sub;
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65535) AS data) AS sub;
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65536) AS data) AS sub;
|
||||
SELECT length(data) AS len FROM (SELECT REPEAT('ä', 65537) AS data) AS sub;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -1821,6 +1821,26 @@ SELECT OCTET_LENGTH(a),a FROM t1;
|
|||
DROP TABLE t1;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-8402 Bug#77473 Bug#21317406 TRUNCATED DATA WITH SUBQUERY & UTF8
|
||||
--echo #
|
||||
--echo #
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SELECT length(repeat(_utf8mb4 0xE29883, 21844)) AS data;
|
||||
SELECT length(data) AS len
|
||||
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21844) AS data ) AS sub;
|
||||
|
||||
SELECT length(repeat(_utf8mb4 0xE29883, 21846)) AS data;
|
||||
SELECT length(data) AS len
|
||||
FROM ( SELECT repeat(_utf8mb4 0xE29883, 21846) AS data ) AS sub;
|
||||
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21844) AS data ) AS sub;
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21845) AS data ) AS sub;
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 21846) AS data ) AS sub;
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65535) AS data ) AS sub;
|
||||
SELECT LENGTH(data) AS len FROM (SELECT REPEAT('☃', 65536) AS data ) AS sub;
|
||||
|
||||
--echo #
|
||||
--echo # End of 5.5 tests
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -41,3 +41,24 @@ UPDATE t1, t2 SET t2.fld2= t2.fld2 + 3;
|
|||
UPDATE t1, t2 SET t1.fld1= t1.fld1 + 3;
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#22037930: INSERT IGNORE FAILS TO IGNORE FOREIGN
|
||||
--echo # KEY CONSTRAINT
|
||||
|
||||
CREATE TABLE t1 (fld1 INT PRIMARY KEY) ENGINE= INNODB;
|
||||
|
||||
CREATE TABLE t2 (fld1 VARCHAR(10), fld2 INT NOT NULL,
|
||||
CONSTRAINT fk FOREIGN KEY (fld2) REFERENCES t1(fld1)) ENGINE= INNODB;
|
||||
|
||||
--echo # Without patch, reports incorrect error.
|
||||
--error ER_NO_REFERENCED_ROW_2
|
||||
INSERT INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
|
||||
--error ER_NO_REFERENCED_ROW_2
|
||||
REPLACE INTO t2 VALUES('abc', 2);
|
||||
|
||||
--enable_warnings
|
||||
INSERT IGNORE INTO t2 VALUES('abc', 2) ON DUPLICATE KEY UPDATE fld1= 'def';
|
||||
--disable_warnings
|
||||
|
||||
DROP TABLE t2, t1;
|
||||
|
|
|
|||
|
|
@ -64,6 +64,25 @@ SELECT monthname('2001-01-01');
|
|||
SELECT monthname('2001-02-01');
|
||||
SELECT monthname('2001-03-01');
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-10052 Illegal mix of collations with DAYNAME(date_field)<>varchar_field
|
||||
--echo #
|
||||
SET NAMES utf8;
|
||||
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
|
||||
INSERT INTO t1 VALUES ('test',now());
|
||||
SET lc_time_names=ru_RU;
|
||||
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
--error ER_CANT_AGGREGATE_2COLLATIONS
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
SET lc_time_names=en_US;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
SET NAMES latin1;
|
||||
SELECT c FROM t1 WHERE DAYNAME(d)<>c;
|
||||
SELECT c FROM t1 WHERE MONTHNAME(d)<>c;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Start of 5.6 tests
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -350,6 +350,11 @@ create table t1(a int);
|
|||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
create table `#mysql50#t1``1` (a int) engine=myisam;
|
||||
--exec $MYSQL_CHECK --fix-table-names --databases test
|
||||
show tables;
|
||||
drop table `t1``1`;
|
||||
|
||||
--echo #
|
||||
--echo #MDEV-7384 [PATCH] add PERSISENT FOR ALL option to mysqlanalyze/mysqlcheck
|
||||
--echo #
|
||||
|
|
|
|||
|
|
@ -758,3 +758,15 @@ CREATE TABLE t1 (s VARCHAR(100));
|
|||
CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
|
||||
SET default_storage_engine = NEW.INNODB;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# MDEV-8328 Evaluation of two "!" operators depends on space in beetween
|
||||
#
|
||||
--error ER_PARSE_ERROR
|
||||
select 0==0;
|
||||
select 1=!0, 1 = ! 0;
|
||||
select !!0, ! ! 0;
|
||||
select 2>!0, 2 > ! 0;
|
||||
select 0<=!0, 0 <= !0;
|
||||
select 1<<!0, 1 << !0;
|
||||
select 0<!0, 0 < ! 0;
|
||||
|
|
|
|||
36
mysql-test/t/ssl_ca.test
Normal file
36
mysql-test/t/ssl_ca.test
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
--source include/have_ssl_communication.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#21920657: SSL-CA FAILS SILENTLY IF THE PATH CANNOT BE FOUND
|
||||
--echo #
|
||||
|
||||
--echo # try to connect with wrong '--ssl-ca' path : should fail
|
||||
--error 1
|
||||
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/wrong-cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'" 2>&1
|
||||
|
||||
--echo # try to connect with correct '--ssl-ca' path : should connect
|
||||
--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
|
||||
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
|
||||
|
||||
--echo #
|
||||
--echo # Bug#21920678: SSL-CA DOES NOT ACCEPT ~USER TILDE HOME DIRECTORY
|
||||
--echo # PATH SUBSTITUTION
|
||||
--echo #
|
||||
|
||||
--let $mysql_test_dir_path= `SELECT IF(LENGTH('$HOME'), REPLACE('=$MYSQL_TEST_DIR', '=$HOME', '=~'), '=$MYSQL_TEST_DIR')`
|
||||
|
||||
--echo # try to connect with '--ssl-ca' option using tilde home directoy
|
||||
--echo # path substitution : should connect
|
||||
--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
|
||||
--exec $MYSQL --ssl-ca$mysql_test_dir_path/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
|
||||
|
||||
--echo # try to connect with '--ssl-key' option using tilde home directoy
|
||||
--echo # path substitution : should connect
|
||||
--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
|
||||
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key$mysql_test_dir_path/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
|
||||
|
||||
--echo # try to connect with '--ssl-cert' option using tilde home directoy
|
||||
--echo # path substitution : should connect
|
||||
--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
|
||||
--exec $MYSQL --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert$mysql_test_dir_path/std_data/client-cert.pem test -e "SHOW STATUS LIKE 'Ssl_cipher'"
|
||||
|
|
@ -387,6 +387,7 @@ drop table t1;
|
|||
|
||||
--echo #
|
||||
--echo # MDEV-9521 Least function returns 0000-00-00 for null date columns instead of null
|
||||
--echo # MDEV-9972 Least function retuns date in date time format
|
||||
--echo #
|
||||
CREATE TABLE t1 (
|
||||
id BIGINT NOT NULL,
|
||||
|
|
|
|||
|
|
@ -19,36 +19,6 @@
|
|||
# Suppress some common (not fatal) errors in system libraries found by valgrind
|
||||
#
|
||||
|
||||
#
|
||||
# Pthread doesn't free all thread specific memory before program exists
|
||||
#
|
||||
{
|
||||
pthread allocate_tls memory loss
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:_dl_allocate_tls
|
||||
fun:allocate_stack
|
||||
fun:pthread_create*
|
||||
}
|
||||
|
||||
{
|
||||
pthread allocate_tls memory loss
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:_dl_allocate_tls
|
||||
fun:pthread_create*
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
pthread allocate_tls memory loss
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
obj:/lib*/ld*.so
|
||||
fun:_dl_allocate_tls
|
||||
fun:pthread_create*
|
||||
}
|
||||
|
||||
{
|
||||
pthead_exit memory loss 1
|
||||
Memcheck:Leak
|
||||
|
|
@ -89,43 +59,6 @@
|
|||
fun:_dl_map_object_from_fd
|
||||
}
|
||||
|
||||
{
|
||||
pthread allocate_dtv memory loss
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:allocate_dtv
|
||||
fun:_dl_allocate_tls_storage
|
||||
fun:__GI__dl_allocate_tls
|
||||
fun:pthread_create
|
||||
}
|
||||
|
||||
{
|
||||
pthread allocate_dtv memory loss second
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:allocate_dtv
|
||||
fun:_dl_allocate_tls
|
||||
fun:pthread_create*
|
||||
}
|
||||
|
||||
{
|
||||
pthread memalign memory loss
|
||||
Memcheck:Leak
|
||||
fun:memalign
|
||||
fun:_dl_allocate_tls_storage
|
||||
fun:__GI__dl_allocate_tls
|
||||
fun:pthread_create
|
||||
}
|
||||
|
||||
{
|
||||
pthread memalign memory loss2
|
||||
Memcheck:Leak
|
||||
fun:memalign
|
||||
fun:tls_get_addr_tail
|
||||
...
|
||||
fun:*ha_initialize_handlerton*
|
||||
}
|
||||
|
||||
{
|
||||
pthread pthread_key_create
|
||||
Memcheck:Leak
|
||||
|
|
@ -1012,18 +945,6 @@
|
|||
fun:nptl_pthread_exit_hack_handler
|
||||
}
|
||||
|
||||
#
|
||||
# Pthread doesn't free all thread specific memory before program exists
|
||||
#
|
||||
{
|
||||
pthread allocate_tls memory loss in 2.6.1.
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
obj:*/ld-*.so
|
||||
fun:_dl_allocate_tls
|
||||
fun:pthread_create*
|
||||
}
|
||||
|
||||
{
|
||||
memory "leak" in backtrace() of glibc 2.9 (not present in 2.13)
|
||||
Memcheck:Leak
|
||||
|
|
@ -1176,6 +1097,23 @@
|
|||
fun:gethostbyaddr_r
|
||||
}
|
||||
|
||||
#
|
||||
# Detached threads may not complete deiniitialization by the time shutdown
|
||||
# thread calls exit. This is unfortunate property of detached threads, which
|
||||
# we currently can only ignore. Unfortunately there is no way to distinguish
|
||||
# between false positives generated by detached threads and real memory leaks
|
||||
# generated by not joined joinable threads. So we hide both cases.
|
||||
#
|
||||
# To avoid enumeration of the whole variety of possible traces we ignore all
|
||||
# "possibly lost" blocks allocated by pthread_create (and it's callees).
|
||||
#
|
||||
{
|
||||
Detached threads memory loss
|
||||
Memcheck:Leak
|
||||
match-leak-kinds:possible
|
||||
...
|
||||
fun:pthread_create*
|
||||
}
|
||||
|
||||
{
|
||||
ConnectSE: unixODBC SQLAllocEnv leaves some "still reachable" pointers
|
||||
|
|
@ -1289,3 +1227,4 @@
|
|||
fun:_dlerror_run
|
||||
fun:dlopen@@GLIBC_2.2.5
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2013, Oracle and/or its affiliates
|
||||
Copyright (c) 1995, 2013, Monty Program Ab
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -507,6 +507,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
|
|||
{
|
||||
/* End of file. Return, what we did copy from the buffer. */
|
||||
info->error= (int) left_length;
|
||||
info->seek_not_done=1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
/*
|
||||
|
|
@ -524,6 +525,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
|
|||
*/
|
||||
info->error= (read_length == (size_t) -1 ? -1 :
|
||||
(int) (read_length+left_length));
|
||||
info->seek_not_done=1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
Count-=length;
|
||||
|
|
@ -572,6 +574,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
|
|||
/* For a read error, return -1, otherwise, what we got in total. */
|
||||
info->error= length == (size_t) -1 ? -1 : (int) (length+left_length);
|
||||
info->read_pos=info->read_end=info->buffer;
|
||||
info->seek_not_done=1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
/*
|
||||
|
|
@ -1870,6 +1873,7 @@ void die(const char* fmt, ...)
|
|||
fprintf(stderr,"Error:");
|
||||
vfprintf(stderr, fmt,va_args);
|
||||
fprintf(stderr,", errno=%d\n", errno);
|
||||
va_end(va_args);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -169,7 +169,9 @@ static int do_test()
|
|||
for (j=0 ; j < 1000 ; j++)
|
||||
if (key1[j] > 1)
|
||||
break;
|
||||
if (key1[j] > 1)
|
||||
// j will be 1000 only if we have no keys in the hash. This only happens
|
||||
// when the parameter recant is set to 0 via command line argument.
|
||||
if (j < 1000 && key1[j] > 1)
|
||||
{
|
||||
HASH_SEARCH_STATE state;
|
||||
printf("- Testing identical read\n");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2010, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Email domain: cam.ac.uk
|
|||
University of Cambridge Computing Service,
|
||||
Cambridge, England.
|
||||
|
||||
Copyright (c) 1997-2015 University of Cambridge
|
||||
Copyright (c) 1997-2016 University of Cambridge
|
||||
All rights reserved
|
||||
|
||||
|
||||
|
|
@ -19,7 +19,7 @@ Written by: Zoltan Herczeg
|
|||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2010-2015 Zoltan Herczeg
|
||||
Copyright(c) 2010-2016 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ Written by: Zoltan Herczeg
|
|||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2009-2015 Zoltan Herczeg
|
||||
Copyright(c) 2009-2016 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@
|
|||
# so it has been removed.
|
||||
# 2013-10-08 PH got rid of the "source" command, which is a bash-ism (use ".")
|
||||
# 2013-11-05 PH added support for PARENS_NEST_LIMIT
|
||||
# 2016-03-01 PH applied Chris Wilson's patch for MSVC static build
|
||||
|
||||
PROJECT(PCRE C CXX)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,12 +4,104 @@ ChangeLog for PCRE
|
|||
Note that the PCRE 8.xx series (PCRE1) is now in a bugfix-only state. All
|
||||
development is happening in the PCRE2 10.xx series.
|
||||
|
||||
Version 8.39 14-June-2016
|
||||
-------------------------
|
||||
|
||||
1. If PCRE_AUTO_CALLOUT was set on a pattern that had a (?# comment between
|
||||
an item and its qualifier (for example, A(?#comment)?B) pcre_compile()
|
||||
misbehaved. This bug was found by the LLVM fuzzer.
|
||||
|
||||
2. Similar to the above, if an isolated \E was present between an item and its
|
||||
qualifier when PCRE_AUTO_CALLOUT was set, pcre_compile() misbehaved. This
|
||||
bug was found by the LLVM fuzzer.
|
||||
|
||||
3. Further to 8.38/46, negated classes such as [^[:^ascii:]\d] were also not
|
||||
working correctly in UCP mode.
|
||||
|
||||
4. The POSIX wrapper function regexec() crashed if the option REG_STARTEND
|
||||
was set when the pmatch argument was NULL. It now returns REG_INVARG.
|
||||
|
||||
5. Allow for up to 32-bit numbers in the ordin() function in pcregrep.
|
||||
|
||||
6. An empty \Q\E sequence between an item and its qualifier caused
|
||||
pcre_compile() to misbehave when auto callouts were enabled. This bug was
|
||||
found by the LLVM fuzzer.
|
||||
|
||||
7. If a pattern that was compiled with PCRE_EXTENDED started with white
|
||||
space or a #-type comment that was followed by (?-x), which turns off
|
||||
PCRE_EXTENDED, and there was no subsequent (?x) to turn it on again,
|
||||
pcre_compile() assumed that (?-x) applied to the whole pattern and
|
||||
consequently mis-compiled it. This bug was found by the LLVM fuzzer.
|
||||
|
||||
8. A call of pcre_copy_named_substring() for a named substring whose number
|
||||
was greater than the space in the ovector could cause a crash.
|
||||
|
||||
9. Yet another buffer overflow bug involved duplicate named groups with a
|
||||
group that reset capture numbers (compare 8.38/7 below). Once again, I have
|
||||
just allowed for more memory, even if not needed. (A proper fix is
|
||||
implemented in PCRE2, but it involves a lot of refactoring.)
|
||||
|
||||
10. pcre_get_substring_list() crashed if the use of \K in a match caused the
|
||||
start of the match to be earlier than the end.
|
||||
|
||||
11. Migrating appropriate PCRE2 JIT improvements to PCRE.
|
||||
|
||||
12. A pattern such as /(?<=((?C)0))/, which has a callout inside a lookbehind
|
||||
assertion, caused pcretest to generate incorrect output, and also to read
|
||||
uninitialized memory (detected by ASAN or valgrind).
|
||||
|
||||
13. A pattern that included (*ACCEPT) in the middle of a sufficiently deeply
|
||||
nested set of parentheses of sufficient size caused an overflow of the
|
||||
compiling workspace (which was diagnosed, but of course is not desirable).
|
||||
|
||||
14. And yet another buffer overflow bug involving duplicate named groups, this
|
||||
time nested, with a nested back reference. Yet again, I have just allowed
|
||||
for more memory, because anything more needs all the refactoring that has
|
||||
been done for PCRE2. An example pattern that provoked this bug is:
|
||||
/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/ and the bug was
|
||||
registered as CVE-2016-1283.
|
||||
|
||||
15. pcretest went into a loop if global matching was requested with an ovector
|
||||
size less than 2. It now gives an error message. This bug was found by
|
||||
afl-fuzz.
|
||||
|
||||
16. An invalid pattern fragment such as (?(?C)0 was not diagnosing an error
|
||||
("assertion expected") when (?(?C) was not followed by an opening
|
||||
parenthesis.
|
||||
|
||||
17. Fixed typo ("&&" for "&") in pcre_study(). Fortunately, this could not
|
||||
actually affect anything, by sheer luck.
|
||||
|
||||
18. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC
|
||||
static compilation.
|
||||
|
||||
19. Modified the RunTest script to incorporate a valgrind suppressions file so
|
||||
that certain errors, provoked by the SSE2 instruction set when JIT is used,
|
||||
are ignored.
|
||||
|
||||
20. A racing condition is fixed in JIT reported by Mozilla.
|
||||
|
||||
21. Minor code refactor to avoid "array subscript is below array bounds"
|
||||
compiler warning.
|
||||
|
||||
22. Minor code refactor to avoid "left shift of negative number" warning.
|
||||
|
||||
23. Fix typo causing compile error when 16- or 32-bit JIT is compiled without
|
||||
UCP support.
|
||||
|
||||
24. Refactor to avoid compiler warnings in pcrecpp.cc.
|
||||
|
||||
25. Refactor to fix a typo in pcre_jit_test.c
|
||||
|
||||
26. Patch to support compiling pcrecpp.cc with Intel compiler.
|
||||
|
||||
|
||||
Version 8.38 23-November-2015
|
||||
-----------------------------
|
||||
|
||||
1. If a group that contained a recursive back reference also contained a
|
||||
forward reference subroutine call followed by a non-forward-reference
|
||||
subroutine call, for example /.((?2)(?R)\1)()/, pcre2_compile() failed to
|
||||
subroutine call, for example /.((?2)(?R)\1)()/, pcre_compile() failed to
|
||||
compile correct code, leading to undefined behaviour or an internally
|
||||
detected error. This bug was discovered by the LLVM fuzzer.
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ Email domain: cam.ac.uk
|
|||
University of Cambridge Computing Service,
|
||||
Cambridge, England.
|
||||
|
||||
Copyright (c) 1997-2015 University of Cambridge
|
||||
Copyright (c) 1997-2016 University of Cambridge
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ Written by: Zoltan Herczeg
|
|||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2010-2015 Zoltan Herczeg
|
||||
Copyright(c) 2010-2016 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ Written by: Zoltan Herczeg
|
|||
Email local part: hzmester
|
||||
Emain domain: freemail.hu
|
||||
|
||||
Copyright(c) 2009-2015 Zoltan Herczeg
|
||||
Copyright(c) 2009-2016 Zoltan Herczeg
|
||||
All rights reserved.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
News about PCRE releases
|
||||
------------------------
|
||||
|
||||
Release 8.39 14-June-2016
|
||||
-------------------------
|
||||
|
||||
Some appropriate PCRE2 JIT improvements have been retro-fitted to PCRE1. Apart
|
||||
from that, this is another bug-fix release. Note that this library (now called
|
||||
PCRE1) is now being maintained for bug fixes only. New projects are advised to
|
||||
use the new PCRE2 libraries.
|
||||
|
||||
|
||||
Release 8.38 23-November-2015
|
||||
-----------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,15 @@ fi
|
|||
./pcretest -C utf >/dev/null
|
||||
utf8=$?
|
||||
|
||||
# We need valgrind suppressions when JIT is in use. (This isn't perfect because
|
||||
# some tests are run with -no-jit, but as PCRE1 is in maintenance only, I have
|
||||
# not bothered about that.)
|
||||
|
||||
./pcretest -C jit >/dev/null
|
||||
if [ $? -eq 1 -a "$valgrind" != "" ] ; then
|
||||
valgrind="$valgrind --suppressions=./testdata/valgrind-jit.supp"
|
||||
fi
|
||||
|
||||
echo "Testing pcregrep main features"
|
||||
|
||||
echo "---------------------------- Test 1 ------------------------------" >testtrygrep
|
||||
|
|
|
|||
32
pcre/RunTest
32
pcre/RunTest
|
|
@ -178,6 +178,7 @@ nojit=
|
|||
sim=
|
||||
skip=
|
||||
valgrind=
|
||||
vjs=
|
||||
|
||||
# This is in case the caller has set aliases (as I do - PH)
|
||||
unset cp ls mv rm
|
||||
|
|
@ -357,6 +358,9 @@ $sim ./pcretest -C jit >/dev/null
|
|||
jit=$?
|
||||
if [ $jit -ne 0 -a "$nojit" != "yes" ] ; then
|
||||
jitopt=-s+
|
||||
if [ "$valgrind" != "" ] ; then
|
||||
vjs="--suppressions=$testdata/valgrind-jit.supp"
|
||||
fi
|
||||
fi
|
||||
|
||||
# If no specific tests were requested, select all. Those that are not
|
||||
|
|
@ -423,7 +427,7 @@ for bmode in "$test8" "$test16" "$test32"; do
|
|||
if [ $do1 = yes ] ; then
|
||||
echo $title1
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput1 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput1 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -441,7 +445,7 @@ fi
|
|||
if [ $do2 = yes ] ; then
|
||||
echo $title2 "(not UTF-$bits)"
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput2 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput2 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -504,7 +508,7 @@ if [ $do3 = yes ] ; then
|
|||
if [ "$locale" != "" ] ; then
|
||||
echo $title3 "(using '$locale' locale)"
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $infile testtry
|
||||
if [ $? = 0 ] ; then
|
||||
if $cf $outfile testtry >teststdout || \
|
||||
$cf $outfile2 testtry >teststdout || \
|
||||
|
|
@ -540,7 +544,7 @@ if [ $do4 = yes ] ; then
|
|||
echo " Skipped because UTF-$bits support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput4 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput4 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput4 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -560,7 +564,7 @@ if [ $do5 = yes ] ; then
|
|||
echo " Skipped because UTF-$bits support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput5 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput5 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput5 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -580,7 +584,7 @@ if [ $do6 = yes ] ; then
|
|||
echo " Skipped because Unicode property support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput6 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput6 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput6 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -602,7 +606,7 @@ if [ $do7 = yes ] ; then
|
|||
echo " Skipped because Unicode property support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput7 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput7 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput7 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -698,7 +702,7 @@ if [ $do12 = yes ] ; then
|
|||
if [ $jit -eq 0 -o "$nojit" = "yes" ] ; then
|
||||
echo " Skipped because JIT is not available or not usable"
|
||||
else
|
||||
$sim $valgrind ./pcretest -q $bmode $testdata/testinput12 testtry
|
||||
$sim $valgrind $vjs ./pcretest -q $bmode $testdata/testinput12 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput12 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -735,7 +739,7 @@ if [ "$do14" = yes ] ; then
|
|||
cp -f $testdata/saved16 testsaved16
|
||||
cp -f $testdata/saved32 testsaved32
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput14 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput14 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput14 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -759,7 +763,7 @@ if [ "$do15" = yes ] ; then
|
|||
echo " Skipped because UTF-$bits support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput15 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput15 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput15 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -783,7 +787,7 @@ if [ $do16 = yes ] ; then
|
|||
echo " Skipped because Unicode property support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput16 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput16 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput16 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -805,7 +809,7 @@ if [ $do17 = yes ] ; then
|
|||
echo " Skipped when running 8-bit tests"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput17 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput17 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput17 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -829,7 +833,7 @@ if [ $do18 = yes ] ; then
|
|||
echo " Skipped because UTF-$bits support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput18 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput18 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput18-$bits testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
@ -853,7 +857,7 @@ if [ $do19 = yes ] ; then
|
|||
echo " Skipped because Unicode property support is not available"
|
||||
else
|
||||
for opt in "" "-s" $jitopt; do
|
||||
$sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput19 testtry
|
||||
$sim $valgrind ${opt:+$vjs} ./pcretest -q $bmode $opt $testdata/testinput19 testtry
|
||||
if [ $? = 0 ] ; then
|
||||
$cf $testdata/testoutput19 testtry
|
||||
if [ $? != 0 ] ; then exit 1; fi
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@ dnl The PCRE_PRERELEASE feature is for identifying release candidates. It might
|
|||
dnl be defined as -RC2, for example. For real releases, it should be empty.
|
||||
|
||||
m4_define(pcre_major, [8])
|
||||
m4_define(pcre_minor, [38])
|
||||
m4_define(pcre_minor, [39])
|
||||
m4_define(pcre_prerelease, [])
|
||||
m4_define(pcre_date, [2015-11-23])
|
||||
m4_define(pcre_date, [2016-06-14])
|
||||
|
||||
# NOTE: The CMakeLists.txt file searches for the above variables in the first
|
||||
# 50 lines of this file. Please update that if the variables above are moved.
|
||||
|
||||
# Libtool shared library interface versions (current:revision:age)
|
||||
m4_define(libpcre_version, [3:6:2])
|
||||
m4_define(libpcre16_version, [2:6:2])
|
||||
m4_define(libpcre32_version, [0:6:0])
|
||||
m4_define(libpcreposix_version, [0:3:0])
|
||||
m4_define(libpcre_version, [3:7:2])
|
||||
m4_define(libpcre16_version, [2:7:2])
|
||||
m4_define(libpcre32_version, [0:7:0])
|
||||
m4_define(libpcreposix_version, [0:4:0])
|
||||
m4_define(libpcrecpp_version, [0:1:0])
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
|
|
|
|||
|
|
@ -315,9 +315,8 @@ documentation for details of how to do this. It is a non-standard way of
|
|||
building PCRE, for use in environments that have limited stacks. Because of the
|
||||
greater use of memory management, it runs more slowly. Separate functions are
|
||||
provided so that special-purpose external code can be used for this case. When
|
||||
used, these functions are always called in a stack-like manner (last obtained,
|
||||
first freed), and always for memory blocks of the same size. There is a
|
||||
discussion about PCRE's stack usage in the
|
||||
used, these functions always allocate memory blocks of the same size. There is
|
||||
a discussion about PCRE's stack usage in the
|
||||
<a href="pcrestack.html"><b>pcrestack</b></a>
|
||||
documentation.
|
||||
</P>
|
||||
|
|
@ -2913,9 +2912,9 @@ Cambridge CB2 3QH, England.
|
|||
</P>
|
||||
<br><a name="SEC26" href="#TOC1">REVISION</a><br>
|
||||
<P>
|
||||
Last updated: 09 February 2014
|
||||
Last updated: 18 December 2015
|
||||
<br>
|
||||
Copyright © 1997-2014 University of Cambridge.
|
||||
Copyright © 1997-2015 University of Cambridge.
|
||||
<br>
|
||||
<p>
|
||||
Return to the <a href="index.html">PCRE index page</a>.
|
||||
|
|
|
|||
1935
pcre/doc/pcre.txt
1935
pcre/doc/pcre.txt
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,4 @@
|
|||
.TH PCREAPI 3 "09 February 2014" "PCRE 8.35"
|
||||
.TH PCREAPI 3 "18 December 2015" "PCRE 8.39"
|
||||
.SH NAME
|
||||
PCRE - Perl-compatible regular expressions
|
||||
.sp
|
||||
|
|
@ -273,9 +273,8 @@ documentation for details of how to do this. It is a non-standard way of
|
|||
building PCRE, for use in environments that have limited stacks. Because of the
|
||||
greater use of memory management, it runs more slowly. Separate functions are
|
||||
provided so that special-purpose external code can be used for this case. When
|
||||
used, these functions are always called in a stack-like manner (last obtained,
|
||||
first freed), and always for memory blocks of the same size. There is a
|
||||
discussion about PCRE's stack usage in the
|
||||
used, these functions always allocate memory blocks of the same size. There is
|
||||
a discussion about PCRE's stack usage in the
|
||||
.\" HREF
|
||||
\fBpcrestack\fP
|
||||
.\"
|
||||
|
|
@ -2914,6 +2913,6 @@ Cambridge CB2 3QH, England.
|
|||
.rs
|
||||
.sp
|
||||
.nf
|
||||
Last updated: 09 February 2014
|
||||
Copyright (c) 1997-2014 University of Cambridge.
|
||||
Last updated: 18 December 2015
|
||||
Copyright (c) 1997-2015 University of Cambridge.
|
||||
.fi
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Copyright (c) 1997-2014 University of Cambridge
|
||||
Copyright (c) 1997-2016 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -485,7 +485,7 @@ static const char error_texts[] =
|
|||
"lookbehind assertion is not fixed length\0"
|
||||
"malformed number or name after (?(\0"
|
||||
"conditional group contains more than two branches\0"
|
||||
"assertion expected after (?(\0"
|
||||
"assertion expected after (?( or (?(?C)\0"
|
||||
"(?R or (?[+-]digits must be followed by )\0"
|
||||
/* 30 */
|
||||
"unknown POSIX class name\0"
|
||||
|
|
@ -560,6 +560,7 @@ static const char error_texts[] =
|
|||
/* 85 */
|
||||
"parentheses are too deeply nested (stack check)\0"
|
||||
"digits missing in \\x{} or \\o{}\0"
|
||||
"regular expression is too complicated\0"
|
||||
;
|
||||
|
||||
/* Table to identify digits and hex digits. This is used when compiling
|
||||
|
|
@ -4566,6 +4567,10 @@ for (;; ptr++)
|
|||
pcre_uint32 ec;
|
||||
pcre_uchar mcbuffer[8];
|
||||
|
||||
/* Come here to restart the loop without advancing the pointer. */
|
||||
|
||||
REDO_LOOP:
|
||||
|
||||
/* Get next character in the pattern */
|
||||
|
||||
c = *ptr;
|
||||
|
|
@ -4591,7 +4596,8 @@ for (;; ptr++)
|
|||
if (code > cd->start_workspace + cd->workspace_size -
|
||||
WORK_SIZE_SAFETY_MARGIN) /* Check for overrun */
|
||||
{
|
||||
*errorcodeptr = ERR52;
|
||||
*errorcodeptr = (code >= cd->start_workspace + cd->workspace_size)?
|
||||
ERR52 : ERR87;
|
||||
goto FAILED;
|
||||
}
|
||||
|
||||
|
|
@ -4645,9 +4651,10 @@ for (;; ptr++)
|
|||
goto FAILED;
|
||||
}
|
||||
|
||||
/* If in \Q...\E, check for the end; if not, we have a literal */
|
||||
/* If in \Q...\E, check for the end; if not, we have a literal. Otherwise an
|
||||
isolated \E is ignored. */
|
||||
|
||||
if (inescq && c != CHAR_NULL)
|
||||
if (c != CHAR_NULL)
|
||||
{
|
||||
if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
|
||||
{
|
||||
|
|
@ -4655,7 +4662,7 @@ for (;; ptr++)
|
|||
ptr++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
else if (inescq)
|
||||
{
|
||||
if (previous_callout != NULL)
|
||||
{
|
||||
|
|
@ -4670,18 +4677,27 @@ for (;; ptr++)
|
|||
}
|
||||
goto NORMAL_CHAR;
|
||||
}
|
||||
/* Control does not reach here. */
|
||||
|
||||
/* Check for the start of a \Q...\E sequence. We must do this here rather
|
||||
than later in case it is immediately followed by \E, which turns it into a
|
||||
"do nothing" sequence. */
|
||||
|
||||
if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
|
||||
{
|
||||
inescq = TRUE;
|
||||
ptr++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* In extended mode, skip white space and comments. We need a loop in order
|
||||
to check for more white space and more comments after a comment. */
|
||||
/* In extended mode, skip white space and comments. */
|
||||
|
||||
if ((options & PCRE_EXTENDED) != 0)
|
||||
{
|
||||
for (;;)
|
||||
const pcre_uchar *wscptr = ptr;
|
||||
while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
|
||||
if (c == CHAR_NUMBER_SIGN)
|
||||
{
|
||||
while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
|
||||
if (c != CHAR_NUMBER_SIGN) break;
|
||||
ptr++;
|
||||
while (*ptr != CHAR_NULL)
|
||||
{
|
||||
|
|
@ -4695,8 +4711,29 @@ for (;; ptr++)
|
|||
if (utf) FORWARDCHAR(ptr);
|
||||
#endif
|
||||
}
|
||||
c = *ptr; /* Either NULL or the char after a newline */
|
||||
}
|
||||
|
||||
/* If we skipped any characters, restart the loop. Otherwise, we didn't see
|
||||
a comment. */
|
||||
|
||||
if (ptr > wscptr) goto REDO_LOOP;
|
||||
}
|
||||
|
||||
/* Skip over (?# comments. We need to do this here because we want to know if
|
||||
the next thing is a quantifier, and these comments may come between an item
|
||||
and its quantifier. */
|
||||
|
||||
if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK &&
|
||||
ptr[2] == CHAR_NUMBER_SIGN)
|
||||
{
|
||||
ptr += 3;
|
||||
while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
|
||||
if (*ptr == CHAR_NULL)
|
||||
{
|
||||
*errorcodeptr = ERR18;
|
||||
goto FAILED;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* See if the next thing is a quantifier. */
|
||||
|
|
@ -4820,15 +4857,15 @@ for (;; ptr++)
|
|||
if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_STARTWORD, 6) == 0)
|
||||
{
|
||||
nestptr = ptr + 7;
|
||||
ptr = sub_start_of_word - 1;
|
||||
continue;
|
||||
ptr = sub_start_of_word;
|
||||
goto REDO_LOOP;
|
||||
}
|
||||
|
||||
if (STRNCMP_UC_C8(ptr+1, STRING_WEIRD_ENDWORD, 6) == 0)
|
||||
{
|
||||
nestptr = ptr + 7;
|
||||
ptr = sub_end_of_word - 1;
|
||||
continue;
|
||||
ptr = sub_end_of_word;
|
||||
goto REDO_LOOP;
|
||||
}
|
||||
|
||||
/* Handle a real character class. */
|
||||
|
|
@ -5046,20 +5083,22 @@ for (;; ptr++)
|
|||
ptr = tempptr + 1;
|
||||
continue;
|
||||
|
||||
/* For the other POSIX classes (ascii, xdigit) we are going to fall
|
||||
through to the non-UCP case and build a bit map for characters with
|
||||
code points less than 256. If we are in a negated POSIX class
|
||||
within a non-negated overall class, characters with code points
|
||||
greater than 255 must all match. In the special case where we have
|
||||
not yet generated any xclass data, and this is the final item in
|
||||
the overall class, we need do nothing: later on, the opcode
|
||||
/* For the other POSIX classes (ascii, cntrl, xdigit) we are going
|
||||
to fall through to the non-UCP case and build a bit map for
|
||||
characters with code points less than 256. If we are in a negated
|
||||
POSIX class, characters with code points greater than 255 must
|
||||
either all match or all not match. In the special case where we
|
||||
have not yet generated any xclass data, and this is the final item
|
||||
in the overall class, we need do nothing: later on, the opcode
|
||||
OP_NCLASS will be used to indicate that characters greater than 255
|
||||
are acceptable. If we have already seen an xclass item or one may
|
||||
follow (we have to assume that it might if this is not the end of
|
||||
the class), explicitly match all wide codepoints. */
|
||||
the class), explicitly list all wide codepoints, which will then
|
||||
either not match or match, depending on whether the class is or is
|
||||
not negated. */
|
||||
|
||||
default:
|
||||
if (!negate_class && local_negate &&
|
||||
if (local_negate &&
|
||||
(xclass || tempptr[2] != CHAR_RIGHT_SQUARE_BRACKET))
|
||||
{
|
||||
*class_uchardata++ = XCL_RANGE;
|
||||
|
|
@ -6529,21 +6568,6 @@ for (;; ptr++)
|
|||
case CHAR_LEFT_PARENTHESIS:
|
||||
ptr++;
|
||||
|
||||
/* First deal with comments. Putting this code right at the start ensures
|
||||
that comments have no bad side effects. */
|
||||
|
||||
if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
|
||||
{
|
||||
ptr += 2;
|
||||
while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
|
||||
if (*ptr == CHAR_NULL)
|
||||
{
|
||||
*errorcodeptr = ERR18;
|
||||
goto FAILED;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Now deal with various "verbs" that can be introduced by '*'. */
|
||||
|
||||
if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
|
||||
|
|
@ -6604,8 +6628,21 @@ for (;; ptr++)
|
|||
cd->had_accept = TRUE;
|
||||
for (oc = cd->open_caps; oc != NULL; oc = oc->next)
|
||||
{
|
||||
*code++ = OP_CLOSE;
|
||||
PUT2INC(code, 0, oc->number);
|
||||
if (lengthptr != NULL)
|
||||
{
|
||||
#ifdef COMPILE_PCRE8
|
||||
*lengthptr += 1 + IMM2_SIZE;
|
||||
#elif defined COMPILE_PCRE16
|
||||
*lengthptr += 2 + IMM2_SIZE;
|
||||
#elif defined COMPILE_PCRE32
|
||||
*lengthptr += 4 + IMM2_SIZE;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
*code++ = OP_CLOSE;
|
||||
PUT2INC(code, 0, oc->number);
|
||||
}
|
||||
}
|
||||
setverb = *code++ =
|
||||
(cd->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT;
|
||||
|
|
@ -6734,6 +6771,15 @@ for (;; ptr++)
|
|||
for (i = 3;; i++) if (!IS_DIGIT(ptr[i])) break;
|
||||
if (ptr[i] == CHAR_RIGHT_PARENTHESIS)
|
||||
tempptr += i + 1;
|
||||
|
||||
/* tempptr should now be pointing to the opening parenthesis of the
|
||||
assertion condition. */
|
||||
|
||||
if (*tempptr != CHAR_LEFT_PARENTHESIS)
|
||||
{
|
||||
*errorcodeptr = ERR28;
|
||||
goto FAILED;
|
||||
}
|
||||
}
|
||||
|
||||
/* For conditions that are assertions, check the syntax, and then exit
|
||||
|
|
@ -7258,7 +7304,7 @@ for (;; ptr++)
|
|||
issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance
|
||||
only mode, we finesse the bug by allowing more memory always. */
|
||||
|
||||
*lengthptr += 2 + 2*LINK_SIZE;
|
||||
*lengthptr += 4 + 4*LINK_SIZE;
|
||||
|
||||
/* It is even worse than that. The current reference may be to an
|
||||
existing named group with a different number (so apparently not
|
||||
|
|
@ -7274,7 +7320,12 @@ for (;; ptr++)
|
|||
so far in order to get the number. If the name is not found, leave
|
||||
the value of recno as 0 for a forward reference. */
|
||||
|
||||
else
|
||||
/* This patch (removing "else") fixes a problem when a reference is
|
||||
to multiple identically named nested groups from within the nest.
|
||||
Once again, it is not the "proper" fix, and it results in an
|
||||
over-allocation of memory. */
|
||||
|
||||
/* else */
|
||||
{
|
||||
ng = cd->named_groups;
|
||||
for (i = 0; i < cd->names_found; i++, ng++)
|
||||
|
|
@ -7585,39 +7636,15 @@ for (;; ptr++)
|
|||
newoptions = (options | set) & (~unset);
|
||||
|
||||
/* If the options ended with ')' this is not the start of a nested
|
||||
group with option changes, so the options change at this level. If this
|
||||
item is right at the start of the pattern, the options can be
|
||||
abstracted and made external in the pre-compile phase, and ignored in
|
||||
the compile phase. This can be helpful when matching -- for instance in
|
||||
caseless checking of required bytes.
|
||||
|
||||
If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
|
||||
definitely *not* at the start of the pattern because something has been
|
||||
compiled. In the pre-compile phase, however, the code pointer can have
|
||||
that value after the start, because it gets reset as code is discarded
|
||||
during the pre-compile. However, this can happen only at top level - if
|
||||
we are within parentheses, the starting BRA will still be present. At
|
||||
any parenthesis level, the length value can be used to test if anything
|
||||
has been compiled at that level. Thus, a test for both these conditions
|
||||
is necessary to ensure we correctly detect the start of the pattern in
|
||||
both phases.
|
||||
|
||||
group with option changes, so the options change at this level.
|
||||
If we are not at the pattern start, reset the greedy defaults and the
|
||||
case value for firstchar and reqchar. */
|
||||
|
||||
if (*ptr == CHAR_RIGHT_PARENTHESIS)
|
||||
{
|
||||
if (code == cd->start_code + 1 + LINK_SIZE &&
|
||||
(lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
|
||||
{
|
||||
cd->external_options = newoptions;
|
||||
}
|
||||
else
|
||||
{
|
||||
greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
|
||||
greedy_non_default = greedy_default ^ 1;
|
||||
req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
|
||||
}
|
||||
greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
|
||||
greedy_non_default = greedy_default ^ 1;
|
||||
req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
|
||||
|
||||
/* Change options at this level, and pass them back for use
|
||||
in subsequent branches. */
|
||||
|
|
@ -7896,16 +7923,6 @@ for (;; ptr++)
|
|||
c = ec;
|
||||
else
|
||||
{
|
||||
if (escape == ESC_Q) /* Handle start of quoted string */
|
||||
{
|
||||
if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
|
||||
ptr += 2; /* avoid empty string */
|
||||
else inescq = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (escape == ESC_E) continue; /* Perl ignores an orphan \E */
|
||||
|
||||
/* For metasequences that actually match a character, we disable the
|
||||
setting of a first character if it hasn't already been set. */
|
||||
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ Arguments:
|
|||
code the compiled regex
|
||||
stringname the name of the capturing substring
|
||||
ovector the vector of matched substrings
|
||||
stringcount number of captured substrings
|
||||
|
||||
Returns: the number of the first that is set,
|
||||
or the number of the last one if none are set,
|
||||
|
|
@ -258,13 +259,16 @@ Returns: the number of the first that is set,
|
|||
|
||||
#if defined COMPILE_PCRE8
|
||||
static int
|
||||
get_first_set(const pcre *code, const char *stringname, int *ovector)
|
||||
get_first_set(const pcre *code, const char *stringname, int *ovector,
|
||||
int stringcount)
|
||||
#elif defined COMPILE_PCRE16
|
||||
static int
|
||||
get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector)
|
||||
get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector,
|
||||
int stringcount)
|
||||
#elif defined COMPILE_PCRE32
|
||||
static int
|
||||
get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector)
|
||||
get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector,
|
||||
int stringcount)
|
||||
#endif
|
||||
{
|
||||
const REAL_PCRE *re = (const REAL_PCRE *)code;
|
||||
|
|
@ -295,7 +299,7 @@ if (entrysize <= 0) return entrysize;
|
|||
for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize)
|
||||
{
|
||||
int n = GET2(entry, 0);
|
||||
if (ovector[n*2] >= 0) return n;
|
||||
if (n < stringcount && ovector[n*2] >= 0) return n;
|
||||
}
|
||||
return GET2(entry, 0);
|
||||
}
|
||||
|
|
@ -402,7 +406,7 @@ pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
|
|||
PCRE_UCHAR32 *buffer, int size)
|
||||
#endif
|
||||
{
|
||||
int n = get_first_set(code, stringname, ovector);
|
||||
int n = get_first_set(code, stringname, ovector, stringcount);
|
||||
if (n <= 0) return n;
|
||||
#if defined COMPILE_PCRE8
|
||||
return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);
|
||||
|
|
@ -457,7 +461,10 @@ pcre_uchar **stringlist;
|
|||
pcre_uchar *p;
|
||||
|
||||
for (i = 0; i < double_count; i += 2)
|
||||
size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1);
|
||||
{
|
||||
size += sizeof(pcre_uchar *) + IN_UCHARS(1);
|
||||
if (ovector[i+1] > ovector[i]) size += IN_UCHARS(ovector[i+1] - ovector[i]);
|
||||
}
|
||||
|
||||
stringlist = (pcre_uchar **)(PUBL(malloc))(size);
|
||||
if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
|
||||
|
|
@ -473,7 +480,7 @@ p = (pcre_uchar *)(stringlist + stringcount + 1);
|
|||
|
||||
for (i = 0; i < double_count; i += 2)
|
||||
{
|
||||
int len = ovector[i+1] - ovector[i];
|
||||
int len = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0;
|
||||
memcpy(p, subject + ovector[i], IN_UCHARS(len));
|
||||
*stringlist++ = p;
|
||||
p += len;
|
||||
|
|
@ -619,7 +626,7 @@ pcre32_get_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
|
|||
PCRE_SPTR32 *stringptr)
|
||||
#endif
|
||||
{
|
||||
int n = get_first_set(code, stringname, ovector);
|
||||
int n = get_first_set(code, stringname, ovector, stringcount);
|
||||
if (n <= 0) return n;
|
||||
#if defined COMPILE_PCRE8
|
||||
return pcre_get_substring(subject, ovector, stringcount, n, stringptr);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Copyright (c) 1997-2014 University of Cambridge
|
||||
Copyright (c) 1997-2016 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -275,7 +275,7 @@ pcre.h(.in) and disable (comment out) this message. */
|
|||
|
||||
typedef pcre_uint16 pcre_uchar;
|
||||
#define UCHAR_SHIFT (1)
|
||||
#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
|
||||
#define IN_UCHARS(x) ((x) * 2)
|
||||
#define MAX_255(c) ((c) <= 255u)
|
||||
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ typedef pcre_uint16 pcre_uchar;
|
|||
|
||||
typedef pcre_uint32 pcre_uchar;
|
||||
#define UCHAR_SHIFT (2)
|
||||
#define IN_UCHARS(x) ((x) << UCHAR_SHIFT)
|
||||
#define IN_UCHARS(x) ((x) * 4)
|
||||
#define MAX_255(c) ((c) <= 255u)
|
||||
#define TABLE_GET(c, table, default) (MAX_255(c)? ((table)[c]):(default))
|
||||
|
||||
|
|
@ -2289,7 +2289,7 @@ enum { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
|
|||
ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
|
||||
ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
|
||||
ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERR77, ERR78, ERR79,
|
||||
ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERRCOUNT };
|
||||
ERR80, ERR81, ERR82, ERR83, ERR84, ERR85, ERR86, ERR87, ERRCOUNT };
|
||||
|
||||
/* JIT compiling modes. The function list is indexed by them. */
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -242,13 +242,17 @@ static struct regression_test_case regression_test_cases[] = {
|
|||
{ MA, 0, "a\\z", "aaa" },
|
||||
{ MA, 0 | F_NOMATCH, "a\\z", "aab" },
|
||||
|
||||
/* Brackets. */
|
||||
/* Brackets and alternatives. */
|
||||
{ MUA, 0, "(ab|bb|cd)", "bacde" },
|
||||
{ MUA, 0, "(?:ab|a)(bc|c)", "ababc" },
|
||||
{ MUA, 0, "((ab|(cc))|(bb)|(?:cd|efg))", "abac" },
|
||||
{ CMUA, 0, "((aB|(Cc))|(bB)|(?:cd|EFg))", "AcCe" },
|
||||
{ MUA, 0, "((ab|(cc))|(bb)|(?:cd|ebg))", "acebebg" },
|
||||
{ MUA, 0, "(?:(a)|(?:b))(cc|(?:d|e))(a|b)k", "accabdbbccbk" },
|
||||
{ MUA, 0, "\xc7\x82|\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" },
|
||||
{ MUA, 0, "=\xc7\x82|#\xc6\x82", "\xf1\x83\x82\x82=\xc7\x82\xc7\x83" },
|
||||
{ MUA, 0, "\xc7\x82\xc7\x83|\xc6\x82\xc6\x82", "\xf1\x83\x82\x82\xc7\x82\xc7\x83" },
|
||||
{ MUA, 0, "\xc6\x82\xc6\x82|\xc7\x83\xc7\x83|\xc8\x84\xc8\x84", "\xf1\x83\x82\x82\xc8\x84\xc8\x84" },
|
||||
|
||||
/* Greedy and non-greedy ? operators. */
|
||||
{ MUA, 0, "(?:a)?a", "laab" },
|
||||
|
|
@ -318,6 +322,14 @@ static struct regression_test_case regression_test_cases[] = {
|
|||
{ CMUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" },
|
||||
{ MUA, 0, "[^\xe1\xbd\xb8][^\xc3\xa9]", "\xe1\xbd\xb8\xe1\xbf\xb8\xc3\xa9\xc3\x89#" },
|
||||
{ MUA, 0, "[^\xe1\xbd\xb8]{3,}?", "##\xe1\xbd\xb8#\xe1\xbd\xb8#\xc3\x89#\xe1\xbd\xb8" },
|
||||
{ MUA, 0, "\\d+123", "987654321,01234" },
|
||||
{ MUA, 0, "abcd*|\\w+xy", "aaaaa,abxyz" },
|
||||
{ MUA, 0, "(?:abc|((?:amc|\\b\\w*xy)))", "aaaaa,abxyz" },
|
||||
{ MUA, 0, "a(?R)|([a-z]++)#", ".abcd.abcd#."},
|
||||
{ MUA, 0, "a(?R)|([a-z]++)#", ".abcd.mbcd#."},
|
||||
{ MUA, 0, ".[ab]*.", "xx" },
|
||||
{ MUA, 0, ".[ab]*a", "xxa" },
|
||||
{ MUA, 0, ".[ab]?.", "xx" },
|
||||
|
||||
/* Bracket repeats with limit. */
|
||||
{ MUA, 0, "(?:(ab){2}){5}M", "abababababababababababM" },
|
||||
|
|
@ -574,6 +586,16 @@ static struct regression_test_case regression_test_cases[] = {
|
|||
{ MUA, 0, "(?:(?=.)??[a-c])+m", "abacdcbacacdcaccam" },
|
||||
{ MUA, 0, "((?!a)?(?!([^a]))?)+$", "acbab" },
|
||||
{ MUA, 0, "((?!a)?\?(?!([^a]))?\?)+$", "acbab" },
|
||||
{ MUA, 0, "a(?=(?C)\\B)b", "ab" },
|
||||
{ MUA, 0, "a(?!(?C)\\B)bb|ab", "abb" },
|
||||
{ MUA, 0, "a(?=\\b|(?C)\\B)b", "ab" },
|
||||
{ MUA, 0, "a(?!\\b|(?C)\\B)bb|ab", "abb" },
|
||||
{ MUA, 0, "c(?(?=(?C)\\B)ab|a)", "cab" },
|
||||
{ MUA, 0, "c(?(?!(?C)\\B)ab|a)", "cab" },
|
||||
{ MUA, 0, "c(?(?=\\b|(?C)\\B)ab|a)", "cab" },
|
||||
{ MUA, 0, "c(?(?!\\b|(?C)\\B)ab|a)", "cab" },
|
||||
{ MUA, 0, "a(?=)b", "ab" },
|
||||
{ MUA, 0 | F_NOMATCH, "a(?!)b", "ab" },
|
||||
|
||||
/* Not empty, ACCEPT, FAIL */
|
||||
{ MUA | PCRE_NOTEMPTY, 0 | F_NOMATCH, "a*", "bcx" },
|
||||
|
|
@ -664,6 +686,7 @@ static struct regression_test_case regression_test_cases[] = {
|
|||
{ PCRE_MULTILINE | PCRE_UTF8 | PCRE_NEWLINE_CRLF | PCRE_FIRSTLINE, 1, ".", "\r\n" },
|
||||
{ PCRE_FIRSTLINE | PCRE_NEWLINE_LF | PCRE_DOTALL, 0 | F_NOMATCH, "ab.", "ab" },
|
||||
{ MUA | PCRE_FIRSTLINE, 1 | F_NOMATCH, "^[a-d0-9]", "\nxx\nd" },
|
||||
{ PCRE_NEWLINE_ANY | PCRE_FIRSTLINE | PCRE_DOTALL, 0, "....a", "012\n0a" },
|
||||
|
||||
/* Recurse. */
|
||||
{ MUA, 0, "(a)(?1)", "aa" },
|
||||
|
|
@ -798,6 +821,9 @@ static struct regression_test_case regression_test_cases[] = {
|
|||
|
||||
/* (*SKIP) verb. */
|
||||
{ MUA, 0 | F_NOMATCH, "(?=a(*SKIP)b)ab|ad", "ad" },
|
||||
{ MUA, 0, "(\\w+(*SKIP)#)", "abcd,xyz#," },
|
||||
{ MUA, 0, "\\w+(*SKIP)#|mm", "abcd,xyz#," },
|
||||
{ MUA, 0 | F_NOMATCH, "b+(?<=(*SKIP)#c)|b+", "#bbb" },
|
||||
|
||||
/* (*THEN) verb. */
|
||||
{ MUA, 0, "((?:a(*THEN)|aab)(*THEN)c|a+)+m", "aabcaabcaabcaabcnacm" },
|
||||
|
|
@ -1534,10 +1560,10 @@ static int regression_tests(void)
|
|||
is_successful = 0;
|
||||
}
|
||||
#endif
|
||||
#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE16
|
||||
if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector16_1[i] || ovector16_1[i] != ovector16_2[i]) {
|
||||
printf("\n16 and 16 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
|
||||
i, ovector16_1[i], ovector16_2[i], ovector16_1[i], ovector16_2[i],
|
||||
#if defined SUPPORT_PCRE16 && defined SUPPORT_PCRE32
|
||||
if (ovector16_1[i] != ovector16_2[i] || ovector16_1[i] != ovector32_1[i] || ovector16_1[i] != ovector32_2[i]) {
|
||||
printf("\n16 and 32 bit: Ovector[%d] value differs(J16:%d,I16:%d,J32:%d,I32:%d): [%d] '%s' @ '%s' \n",
|
||||
i, ovector16_1[i], ovector16_2[i], ovector32_1[i], ovector32_2[i],
|
||||
total, current->pattern, current->input);
|
||||
is_successful = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1371,7 +1371,7 @@ do
|
|||
for (c = 0; c < 16; c++) start_bits[c] |= map[c];
|
||||
for (c = 128; c < 256; c++)
|
||||
{
|
||||
if ((map[c/8] && (1 << (c&7))) != 0)
|
||||
if ((map[c/8] & (1 << (c&7))) != 0)
|
||||
{
|
||||
int d = (c >> 6) | 0xc0; /* Set bit for this starter */
|
||||
start_bits[d/8] |= (1 << (d&7)); /* and then skip on to the */
|
||||
|
|
|
|||
130
pcre/pcrecpp.cc
130
pcre/pcrecpp.cc
|
|
@ -66,7 +66,7 @@ Arg RE::no_arg((void*)NULL);
|
|||
// inclusive test if we ever needed it. (Note that not only the
|
||||
// __attribute__ syntax, but also __USER_LABEL_PREFIX__, are
|
||||
// gnu-specific.)
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__)
|
||||
#if defined(__GNUC__) && __GNUC__ >= 3 && defined(__ELF__) && !defined(__INTEL_COMPILER)
|
||||
# define ULP_AS_STRING(x) ULP_AS_STRING_INTERNAL(x)
|
||||
# define ULP_AS_STRING_INTERNAL(x) #x
|
||||
# define USER_LABEL_PREFIX_STR ULP_AS_STRING(__USER_LABEL_PREFIX__)
|
||||
|
|
@ -168,22 +168,22 @@ bool RE::FullMatch(const StringPiece& text,
|
|||
const Arg& ptr16) const {
|
||||
const Arg* args[kMaxArgs];
|
||||
int n = 0;
|
||||
if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
|
||||
if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
|
||||
done:
|
||||
|
||||
int consumed;
|
||||
|
|
@ -210,22 +210,22 @@ bool RE::PartialMatch(const StringPiece& text,
|
|||
const Arg& ptr16) const {
|
||||
const Arg* args[kMaxArgs];
|
||||
int n = 0;
|
||||
if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
|
||||
if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
|
||||
done:
|
||||
|
||||
int consumed;
|
||||
|
|
@ -252,22 +252,22 @@ bool RE::Consume(StringPiece* input,
|
|||
const Arg& ptr16) const {
|
||||
const Arg* args[kMaxArgs];
|
||||
int n = 0;
|
||||
if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
|
||||
if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
|
||||
done:
|
||||
|
||||
int consumed;
|
||||
|
|
@ -300,22 +300,22 @@ bool RE::FindAndConsume(StringPiece* input,
|
|||
const Arg& ptr16) const {
|
||||
const Arg* args[kMaxArgs];
|
||||
int n = 0;
|
||||
if (&ptr1 == &no_arg) goto done; args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) goto done; args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) goto done; args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) goto done; args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) goto done; args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) goto done; args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) goto done; args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) goto done; args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) goto done; args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) goto done; args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) goto done; args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) goto done; args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) goto done; args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) goto done; args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) goto done; args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) goto done; args[n++] = &ptr16;
|
||||
if (&ptr1 == &no_arg) { goto done; } args[n++] = &ptr1;
|
||||
if (&ptr2 == &no_arg) { goto done; } args[n++] = &ptr2;
|
||||
if (&ptr3 == &no_arg) { goto done; } args[n++] = &ptr3;
|
||||
if (&ptr4 == &no_arg) { goto done; } args[n++] = &ptr4;
|
||||
if (&ptr5 == &no_arg) { goto done; } args[n++] = &ptr5;
|
||||
if (&ptr6 == &no_arg) { goto done; } args[n++] = &ptr6;
|
||||
if (&ptr7 == &no_arg) { goto done; } args[n++] = &ptr7;
|
||||
if (&ptr8 == &no_arg) { goto done; } args[n++] = &ptr8;
|
||||
if (&ptr9 == &no_arg) { goto done; } args[n++] = &ptr9;
|
||||
if (&ptr10 == &no_arg) { goto done; } args[n++] = &ptr10;
|
||||
if (&ptr11 == &no_arg) { goto done; } args[n++] = &ptr11;
|
||||
if (&ptr12 == &no_arg) { goto done; } args[n++] = &ptr12;
|
||||
if (&ptr13 == &no_arg) { goto done; } args[n++] = &ptr13;
|
||||
if (&ptr14 == &no_arg) { goto done; } args[n++] = &ptr14;
|
||||
if (&ptr15 == &no_arg) { goto done; } args[n++] = &ptr15;
|
||||
if (&ptr16 == &no_arg) { goto done; } args[n++] = &ptr16;
|
||||
done:
|
||||
|
||||
int consumed;
|
||||
|
|
|
|||
|
|
@ -2437,7 +2437,7 @@ return options;
|
|||
static char *
|
||||
ordin(int n)
|
||||
{
|
||||
static char buffer[8];
|
||||
static char buffer[14];
|
||||
char *p = buffer;
|
||||
sprintf(p, "%d", n);
|
||||
while (*p != 0) p++;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
and semantics are as close as possible to those of the Perl 5 language.
|
||||
|
||||
Written by Philip Hazel
|
||||
Copyright (c) 1997-2014 University of Cambridge
|
||||
Copyright (c) 1997-2016 University of Cambridge
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -173,7 +173,8 @@ static const int eint[] = {
|
|||
REG_BADPAT, /* group name must start with a non-digit */
|
||||
/* 85 */
|
||||
REG_BADPAT, /* parentheses too deeply nested (stack check) */
|
||||
REG_BADPAT /* missing digits in \x{} or \o{} */
|
||||
REG_BADPAT, /* missing digits in \x{} or \o{} */
|
||||
REG_BADPAT /* pattern too complicated */
|
||||
};
|
||||
|
||||
/* Table of texts corresponding to POSIX error codes */
|
||||
|
|
@ -364,6 +365,7 @@ start location rather than being passed as a PCRE "starting offset". */
|
|||
|
||||
if ((eflags & REG_STARTEND) != 0)
|
||||
{
|
||||
if (pmatch == NULL) return REG_INVARG;
|
||||
so = pmatch[0].rm_so;
|
||||
eo = pmatch[0].rm_eo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2250,7 +2250,7 @@ data is not zero. */
|
|||
static int callout(pcre_callout_block *cb)
|
||||
{
|
||||
FILE *f = (first_callout | callout_extra)? outfile : NULL;
|
||||
int i, pre_start, post_start, subject_length;
|
||||
int i, current_position, pre_start, post_start, subject_length;
|
||||
|
||||
if (callout_extra)
|
||||
{
|
||||
|
|
@ -2280,14 +2280,19 @@ printed lengths of the substrings. */
|
|||
|
||||
if (f != NULL) fprintf(f, "--->");
|
||||
|
||||
/* If a lookbehind is involved, the current position may be earlier than the
|
||||
match start. If so, use the match start instead. */
|
||||
|
||||
current_position = (cb->current_position >= cb->start_match)?
|
||||
cb->current_position : cb->start_match;
|
||||
|
||||
PCHARS(pre_start, cb->subject, 0, cb->start_match, f);
|
||||
PCHARS(post_start, cb->subject, cb->start_match,
|
||||
cb->current_position - cb->start_match, f);
|
||||
current_position - cb->start_match, f);
|
||||
|
||||
PCHARS(subject_length, cb->subject, 0, cb->subject_length, NULL);
|
||||
|
||||
PCHARSV(cb->subject, cb->current_position,
|
||||
cb->subject_length - cb->current_position, f);
|
||||
PCHARSV(cb->subject, current_position, cb->subject_length - current_position, f);
|
||||
|
||||
if (f != NULL) fprintf(f, "\n");
|
||||
|
||||
|
|
@ -5612,6 +5617,12 @@ while (!done)
|
|||
break;
|
||||
}
|
||||
|
||||
if (use_size_offsets < 2)
|
||||
{
|
||||
fprintf(outfile, "Cannot do global matching with an ovector size < 2\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we have matched an empty string, first check to see if we are at
|
||||
the end of the subject. If so, the /g loop is over. Otherwise, mimic what
|
||||
Perl's /g options does. This turns out to be rather cunning. First we set
|
||||
|
|
@ -5740,3 +5751,4 @@ return yield;
|
|||
}
|
||||
|
||||
/* End of pcretest.c */
|
||||
|
||||
|
|
|
|||
2
pcre/testdata/testinput11
vendored
2
pcre/testdata/testinput11
vendored
|
|
@ -138,4 +138,6 @@ is required for these tests. --/
|
|||
|
||||
/.((?2)(?R)\1)()/B
|
||||
|
||||
/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
|
||||
|
||||
/-- End of testinput11 --/
|
||||
|
|
|
|||
26
pcre/testdata/testinput2
vendored
26
pcre/testdata/testinput2
vendored
|
|
@ -4217,4 +4217,30 @@ backtracking verbs. --/
|
|||
|
||||
/a[[:punct:]b]/BZ
|
||||
|
||||
/L(?#(|++<!(2)?/BZ
|
||||
|
||||
/L(?#(|++<!(2)?/BOZ
|
||||
|
||||
/L(?#(|++<!(2)?/BCZ
|
||||
|
||||
/L(?#(|++<!(2)?/BCOZ
|
||||
|
||||
/(A*)\E+/CBZ
|
||||
|
||||
/()\Q\E*]/BCZ
|
||||
|
||||
/(?<A>)(?J:(?<B>)(?<B>))(?<C>)/
|
||||
\O\CC
|
||||
|
||||
/(?=a\K)/
|
||||
ring bpattingbobnd $ 1,oern cou \rb\L
|
||||
|
||||
/(?<=((?C)0))/
|
||||
9010
|
||||
abcd
|
||||
|
||||
/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/
|
||||
|
||||
/\N(?(?C)0?!.)*/
|
||||
|
||||
/-- End of testinput2 --/
|
||||
|
|
|
|||
9
pcre/testdata/testinput6
vendored
9
pcre/testdata/testinput6
vendored
|
|
@ -1553,4 +1553,13 @@
|
|||
\x{200}
|
||||
\x{37e}
|
||||
|
||||
/[^[:^ascii:]\d]/8W
|
||||
a
|
||||
~
|
||||
0
|
||||
\a
|
||||
\x{7f}
|
||||
\x{389}
|
||||
\x{20ac}
|
||||
|
||||
/-- End of testinput6 --/
|
||||
|
|
|
|||
4
pcre/testdata/testinput7
vendored
4
pcre/testdata/testinput7
vendored
|
|
@ -853,4 +853,8 @@ of case for anything other than the ASCII letters. --/
|
|||
|
||||
/a[b[:punct:]]/8WBZ
|
||||
|
||||
/L(?#(|++<!(2)?/B8COZ
|
||||
|
||||
/L(?#(|++<!(2)?/B8WCZ
|
||||
|
||||
/-- End of testinput7 --/
|
||||
|
|
|
|||
5
pcre/testdata/testoutput11-16
vendored
5
pcre/testdata/testoutput11-16
vendored
|
|
@ -231,7 +231,7 @@ Memory allocation (code space): 73
|
|||
------------------------------------------------------------------
|
||||
|
||||
/(?P<a>a)...(?P=a)bbb(?P>a)d/BM
|
||||
Memory allocation (code space): 77
|
||||
Memory allocation (code space): 93
|
||||
------------------------------------------------------------------
|
||||
0 24 Bra
|
||||
2 5 CBra 1
|
||||
|
|
@ -765,4 +765,7 @@ Memory allocation (code space): 14
|
|||
25 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
|
||||
Failed: regular expression is too complicated at offset 490
|
||||
|
||||
/-- End of testinput11 --/
|
||||
|
|
|
|||
5
pcre/testdata/testoutput11-32
vendored
5
pcre/testdata/testoutput11-32
vendored
|
|
@ -231,7 +231,7 @@ Memory allocation (code space): 155
|
|||
------------------------------------------------------------------
|
||||
|
||||
/(?P<a>a)...(?P=a)bbb(?P>a)d/BM
|
||||
Memory allocation (code space): 157
|
||||
Memory allocation (code space): 189
|
||||
------------------------------------------------------------------
|
||||
0 24 Bra
|
||||
2 5 CBra 1
|
||||
|
|
@ -765,4 +765,7 @@ Memory allocation (code space): 28
|
|||
25 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
|
||||
Failed: missing ) at offset 509
|
||||
|
||||
/-- End of testinput11 --/
|
||||
|
|
|
|||
5
pcre/testdata/testoutput11-8
vendored
5
pcre/testdata/testoutput11-8
vendored
|
|
@ -231,7 +231,7 @@ Memory allocation (code space): 45
|
|||
------------------------------------------------------------------
|
||||
|
||||
/(?P<a>a)...(?P=a)bbb(?P>a)d/BM
|
||||
Memory allocation (code space): 50
|
||||
Memory allocation (code space): 62
|
||||
------------------------------------------------------------------
|
||||
0 30 Bra
|
||||
3 7 CBra 1
|
||||
|
|
@ -765,4 +765,7 @@ Memory allocation (code space): 10
|
|||
38 End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
|
||||
Failed: missing ) at offset 509
|
||||
|
||||
/-- End of testinput11 --/
|
||||
|
|
|
|||
132
pcre/testdata/testoutput2
vendored
132
pcre/testdata/testoutput2
vendored
|
|
@ -419,7 +419,7 @@ Need char = '>'
|
|||
|
||||
/(?U)<.*>/I
|
||||
Capturing subpattern count = 0
|
||||
Options: ungreedy
|
||||
No options
|
||||
First char = '<'
|
||||
Need char = '>'
|
||||
abc<def>ghi<klm>nop
|
||||
|
|
@ -443,7 +443,7 @@ Need char = '='
|
|||
|
||||
/(?U)={3,}?/I
|
||||
Capturing subpattern count = 0
|
||||
Options: ungreedy
|
||||
No options
|
||||
First char = '='
|
||||
Need char = '='
|
||||
abc========def
|
||||
|
|
@ -477,7 +477,7 @@ Failed: lookbehind assertion is not fixed length at offset 12
|
|||
|
||||
/(?i)abc/I
|
||||
Capturing subpattern count = 0
|
||||
Options: caseless
|
||||
No options
|
||||
First char = 'a' (caseless)
|
||||
Need char = 'c' (caseless)
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ No need char
|
|||
|
||||
/(?i)^1234/I
|
||||
Capturing subpattern count = 0
|
||||
Options: anchored caseless
|
||||
Options: anchored
|
||||
No first char
|
||||
No need char
|
||||
|
||||
|
|
@ -502,7 +502,7 @@ No need char
|
|||
/(?s).*/I
|
||||
Capturing subpattern count = 0
|
||||
May match empty string
|
||||
Options: anchored dotall
|
||||
Options: anchored
|
||||
No first char
|
||||
No need char
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ Starting chars: a b c d
|
|||
|
||||
/(?i)[abcd]/IS
|
||||
Capturing subpattern count = 0
|
||||
Options: caseless
|
||||
No options
|
||||
No first char
|
||||
No need char
|
||||
Subject length lower bound = 1
|
||||
|
|
@ -524,7 +524,7 @@ Starting chars: A B C D a b c d
|
|||
|
||||
/(?m)[xy]|(b|c)/IS
|
||||
Capturing subpattern count = 1
|
||||
Options: multiline
|
||||
No options
|
||||
No first char
|
||||
No need char
|
||||
Subject length lower bound = 1
|
||||
|
|
@ -538,7 +538,7 @@ No need char
|
|||
|
||||
/(?i)(^a|^b)/Im
|
||||
Capturing subpattern count = 1
|
||||
Options: caseless multiline
|
||||
Options: multiline
|
||||
First char at start or follows newline
|
||||
No need char
|
||||
|
||||
|
|
@ -555,13 +555,13 @@ Failed: malformed number or name after (?( at offset 4
|
|||
Failed: malformed number or name after (?( at offset 4
|
||||
|
||||
/(?(?i))/
|
||||
Failed: assertion expected after (?( at offset 3
|
||||
Failed: assertion expected after (?( or (?(?C) at offset 3
|
||||
|
||||
/(?(abc))/
|
||||
Failed: reference to non-existent subpattern at offset 7
|
||||
|
||||
/(?(?<ab))/
|
||||
Failed: assertion expected after (?( at offset 3
|
||||
Failed: assertion expected after (?( or (?(?C) at offset 3
|
||||
|
||||
/((?s)blah)\s+\1/I
|
||||
Capturing subpattern count = 1
|
||||
|
|
@ -1179,7 +1179,7 @@ No need char
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
Capturing subpattern count = 1
|
||||
Options: anchored dotall
|
||||
Options: anchored
|
||||
No first char
|
||||
No need char
|
||||
|
||||
|
|
@ -2735,7 +2735,7 @@ No match
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
Capturing subpattern count = 0
|
||||
Options: caseless extended
|
||||
Options: extended
|
||||
First char = 'a' (caseless)
|
||||
Need char = 'c' (caseless)
|
||||
|
||||
|
|
@ -2748,7 +2748,7 @@ Need char = 'c' (caseless)
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
Capturing subpattern count = 0
|
||||
Options: caseless extended
|
||||
Options: extended
|
||||
First char = 'a' (caseless)
|
||||
Need char = 'c' (caseless)
|
||||
|
||||
|
|
@ -3095,7 +3095,7 @@ Need char = 'b'
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
Capturing subpattern count = 0
|
||||
Options: ungreedy
|
||||
No options
|
||||
First char = 'x'
|
||||
Need char = 'b'
|
||||
xaaaab
|
||||
|
|
@ -3497,7 +3497,7 @@ Need char = 'c'
|
|||
|
||||
/(?i)[ab]/IS
|
||||
Capturing subpattern count = 0
|
||||
Options: caseless
|
||||
No options
|
||||
No first char
|
||||
No need char
|
||||
Subject length lower bound = 1
|
||||
|
|
@ -6299,7 +6299,7 @@ Capturing subpattern count = 3
|
|||
Named capturing subpatterns:
|
||||
A 2
|
||||
A 3
|
||||
Options: anchored dupnames
|
||||
Options: anchored
|
||||
Duplicate name status changes
|
||||
No first char
|
||||
No need char
|
||||
|
|
@ -7870,7 +7870,7 @@ No match
|
|||
Failed: malformed number or name after (?( at offset 6
|
||||
|
||||
/(?(''))/
|
||||
Failed: assertion expected after (?( at offset 4
|
||||
Failed: assertion expected after (?( or (?(?C) at offset 4
|
||||
|
||||
/(?('R')stuff)/
|
||||
Failed: reference to non-existent subpattern at offset 7
|
||||
|
|
@ -14346,7 +14346,7 @@ No match
|
|||
"((?2)+)((?1))"
|
||||
|
||||
"(?(?<E>.*!.*)?)"
|
||||
Failed: assertion expected after (?( at offset 3
|
||||
Failed: assertion expected after (?( or (?(?C) at offset 3
|
||||
|
||||
"X((?2)()*+){2}+"BZ
|
||||
------------------------------------------------------------------
|
||||
|
|
@ -14574,4 +14574,100 @@ No match
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/BZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
L?+
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/BOZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
L?
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/BCZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 14
|
||||
L?+
|
||||
Callout 255 14 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/BCOZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 14
|
||||
L?
|
||||
Callout 255 14 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/(A*)\E+/CBZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 7
|
||||
SCBra 1
|
||||
Callout 255 1 2
|
||||
A*
|
||||
Callout 255 3 0
|
||||
KetRmax
|
||||
Callout 255 7 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/()\Q\E*]/BCZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 7
|
||||
Brazero
|
||||
SCBra 1
|
||||
Callout 255 1 0
|
||||
KetRmax
|
||||
Callout 255 7 1
|
||||
]
|
||||
Callout 255 8 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/(?<A>)(?J:(?<B>)(?<B>))(?<C>)/
|
||||
\O\CC
|
||||
Matched, but too many substrings
|
||||
copy substring C failed -7
|
||||
|
||||
/(?=a\K)/
|
||||
ring bpattingbobnd $ 1,oern cou \rb\L
|
||||
Start of matched string is beyond its end - displaying from end to start.
|
||||
0: a
|
||||
0L
|
||||
|
||||
/(?<=((?C)0))/
|
||||
9010
|
||||
--->9010
|
||||
0 ^ 0
|
||||
0 ^ 0
|
||||
0:
|
||||
1: 0
|
||||
abcd
|
||||
--->abcd
|
||||
0 ^ 0
|
||||
0 ^ 0
|
||||
0 ^ 0
|
||||
0 ^ 0
|
||||
No match
|
||||
|
||||
/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/
|
||||
|
||||
/\N(?(?C)0?!.)*/
|
||||
Failed: assertion expected after (?( or (?(?C) at offset 4
|
||||
|
||||
/-- End of testinput2 --/
|
||||
|
|
|
|||
16
pcre/testdata/testoutput6
vendored
16
pcre/testdata/testoutput6
vendored
|
|
@ -2557,4 +2557,20 @@ No match
|
|||
\x{37e}
|
||||
0: \x{37e}
|
||||
|
||||
/[^[:^ascii:]\d]/8W
|
||||
a
|
||||
0: a
|
||||
~
|
||||
0: ~
|
||||
0
|
||||
No match
|
||||
\a
|
||||
0: \x{07}
|
||||
\x{7f}
|
||||
0: \x{7f}
|
||||
\x{389}
|
||||
No match
|
||||
\x{20ac}
|
||||
No match
|
||||
|
||||
/-- End of testinput6 --/
|
||||
|
|
|
|||
20
pcre/testdata/testoutput7
vendored
20
pcre/testdata/testoutput7
vendored
|
|
@ -2348,4 +2348,24 @@ No match
|
|||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/B8COZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 14
|
||||
L?
|
||||
Callout 255 14 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/L(?#(|++<!(2)?/B8WCZ
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
Callout 255 0 14
|
||||
L?+
|
||||
Callout 255 14 0
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/-- End of testinput7 --/
|
||||
|
|
|
|||
|
|
@ -190,6 +190,7 @@ int Url_http::send(const char* data, size_t data_length)
|
|||
break;
|
||||
|
||||
closesocket(fd);
|
||||
fd= INVALID_SOCKET;
|
||||
}
|
||||
|
||||
freeaddrinfo(addrs);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
|
||||
# MA 02110-1301, USA
|
||||
|
||||
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
|
|
@ -621,7 +621,11 @@ sub my_which
|
|||
my ($command) = @_;
|
||||
my (@paths, $path);
|
||||
|
||||
return $command if (-f $command && -x $command);
|
||||
# If the argument is not 'my_print_defaults' then it would be of the format
|
||||
# <absolute_path>/<program>
|
||||
return $command if ($command ne 'my_print_defaults' && -f $command &&
|
||||
-x $command);
|
||||
|
||||
@paths = split(':', $ENV{'PATH'});
|
||||
foreach $path (@paths)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1045,28 +1045,44 @@ static int add_init_command(struct st_mysql_options *options, const char *cmd)
|
|||
} while (0)
|
||||
|
||||
|
||||
#define EXTENSION_SET_STRING(OPTS, X, STR) \
|
||||
#define EXTENSION_SET_STRING_X(OPTS, X, STR, dup) \
|
||||
do { \
|
||||
if ((OPTS)->extension) \
|
||||
my_free((OPTS)->extension->X); \
|
||||
else \
|
||||
ALLOCATE_EXTENSIONS(OPTS); \
|
||||
(OPTS)->extension->X= ((STR) != NULL) ? \
|
||||
my_strdup((STR), MYF(MY_WME)) : NULL; \
|
||||
dup((STR), MYF(MY_WME)) : NULL; \
|
||||
} while (0)
|
||||
|
||||
#define EXTENSION_SET_STRING(OPTS, X, STR) \
|
||||
EXTENSION_SET_STRING_X(OPTS, X, STR, my_strdup)
|
||||
|
||||
|
||||
#if defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY)
|
||||
#define SET_SSL_OPTION(OPTS, opt_var, arg) \
|
||||
my_free((OPTS)->opt_var); \
|
||||
(OPTS)->opt_var= arg ? my_strdup(arg, MYF(MY_WME)) : NULL;
|
||||
#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) \
|
||||
EXTENSION_SET_STRING((OPTS), X, (STR));
|
||||
#define SET_SSL_OPTION_X(OPTS, opt_var, arg, dup) \
|
||||
my_free((OPTS)->opt_var); \
|
||||
(OPTS)->opt_var= arg ? dup(arg, MYF(MY_WME)) : NULL;
|
||||
#define EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, dup) \
|
||||
EXTENSION_SET_STRING_X((OPTS), X, (STR), dup);
|
||||
|
||||
static char *set_ssl_option_unpack_path(const char *arg, myf flags)
|
||||
{
|
||||
char buff[FN_REFLEN + 1];
|
||||
unpack_filename(buff, (char *)arg);
|
||||
return my_strdup(buff, flags);
|
||||
}
|
||||
|
||||
#else
|
||||
#define SET_SSL_OPTION(OPTS, opt_var,arg) do { } while(0)
|
||||
#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) do { } while(0)
|
||||
#define SET_SSL_OPTION_X(OPTS, opt_var,arg, dup) do { } while(0)
|
||||
#define EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, dup) do { } while(0)
|
||||
#endif /* defined(HAVE_OPENSSL) && !defined(EMBEDDED_LIBRARY) */
|
||||
|
||||
#define SET_SSL_OPTION(OPTS, opt_var,arg) SET_SSL_OPTION_X(OPTS, opt_var, arg, my_strdup)
|
||||
#define EXTENSION_SET_SSL_STRING(OPTS, X, STR) EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, my_strdup)
|
||||
#define SET_SSL_PATH_OPTION(OPTS, opt_var,arg) SET_SSL_OPTION_X(OPTS, opt_var, arg, set_ssl_option_unpack_path)
|
||||
#define EXTENSION_SET_SSL_PATH_STRING(OPTS, X, STR) EXTENSION_SET_SSL_STRING_X(OPTS, X, STR, set_ssl_option_unpack_path)
|
||||
|
||||
void mysql_read_default_options(struct st_mysql_options *options,
|
||||
const char *filename,const char *group)
|
||||
{
|
||||
|
|
@ -4373,25 +4389,25 @@ mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg)
|
|||
mysql->net.vio->async_context= ctxt;
|
||||
break;
|
||||
case MYSQL_OPT_SSL_KEY:
|
||||
SET_SSL_OPTION(&mysql->options,ssl_key, arg);
|
||||
SET_SSL_PATH_OPTION(&mysql->options,ssl_key, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CERT:
|
||||
SET_SSL_OPTION(&mysql->options, ssl_cert, arg);
|
||||
SET_SSL_PATH_OPTION(&mysql->options, ssl_cert, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CA:
|
||||
SET_SSL_OPTION(&mysql->options,ssl_ca, arg);
|
||||
SET_SSL_PATH_OPTION(&mysql->options,ssl_ca, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CAPATH:
|
||||
SET_SSL_OPTION(&mysql->options,ssl_capath, arg);
|
||||
SET_SSL_PATH_OPTION(&mysql->options,ssl_capath, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CIPHER:
|
||||
SET_SSL_OPTION(&mysql->options,ssl_cipher, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CRL:
|
||||
EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crl, arg);
|
||||
EXTENSION_SET_SSL_PATH_STRING(&mysql->options, ssl_crl, arg);
|
||||
break;
|
||||
case MYSQL_OPT_SSL_CRLPATH:
|
||||
EXTENSION_SET_SSL_STRING(&mysql->options, ssl_crlpath, arg);
|
||||
EXTENSION_SET_SSL_PATH_STRING(&mysql->options, ssl_crlpath, arg);
|
||||
break;
|
||||
case MYSQL_OPT_CONNECT_ATTR_RESET:
|
||||
ENSURE_EXTENSIONS_PRESENT(&mysql->options);
|
||||
|
|
|
|||
|
|
@ -1816,6 +1816,7 @@ Field_str::Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
|
|||
if (charset_arg->state & MY_CS_BINSORT)
|
||||
flags|=BINARY_FLAG;
|
||||
field_derivation= DERIVATION_IMPLICIT;
|
||||
field_repertoire= my_charset_repertoire(charset_arg);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
28
sql/field.h
28
sql/field.h
|
|
@ -884,11 +884,12 @@ public:
|
|||
matches collation of the field (needed only for real string types).
|
||||
*/
|
||||
virtual bool match_collation_to_optimize_range() const { return false; }
|
||||
virtual void set_charset(CHARSET_INFO *charset_arg) { }
|
||||
virtual enum Derivation derivation(void) const
|
||||
{ return DERIVATION_IMPLICIT; }
|
||||
virtual uint repertoire(void) const { return MY_REPERTOIRE_UNICODE30; }
|
||||
virtual void set_derivation(enum Derivation derivation_arg) { }
|
||||
virtual void set_derivation(enum Derivation derivation_arg,
|
||||
uint repertoire_arg)
|
||||
{ }
|
||||
virtual int set_time() { return 1; }
|
||||
bool set_warning(Sql_condition::enum_warning_level, unsigned int code,
|
||||
int cuted_increment) const;
|
||||
|
|
@ -1132,8 +1133,10 @@ public:
|
|||
|
||||
class Field_str :public Field {
|
||||
protected:
|
||||
// TODO-10.2: Reuse DTCollation instead of these three members
|
||||
CHARSET_INFO *field_charset;
|
||||
enum Derivation field_derivation;
|
||||
uint field_repertoire;
|
||||
public:
|
||||
Field_str(uchar *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
|
||||
uchar null_bit_arg, utype unireg_check_arg,
|
||||
|
|
@ -1144,15 +1147,15 @@ public:
|
|||
int store(longlong nr, bool unsigned_val)=0;
|
||||
int store_decimal(const my_decimal *);
|
||||
int store(const char *to,uint length,CHARSET_INFO *cs)=0;
|
||||
uint repertoire(void) const
|
||||
{
|
||||
return my_charset_repertoire(field_charset);
|
||||
}
|
||||
uint repertoire(void) const { return field_repertoire; }
|
||||
CHARSET_INFO *charset(void) const { return field_charset; }
|
||||
void set_charset(CHARSET_INFO *charset_arg) { field_charset= charset_arg; }
|
||||
enum Derivation derivation(void) const { return field_derivation; }
|
||||
virtual void set_derivation(enum Derivation derivation_arg)
|
||||
{ field_derivation= derivation_arg; }
|
||||
void set_derivation(enum Derivation derivation_arg,
|
||||
uint repertoire_arg)
|
||||
{
|
||||
field_derivation= derivation_arg;
|
||||
field_repertoire= repertoire_arg;
|
||||
}
|
||||
bool binary() const { return field_charset == &my_charset_bin; }
|
||||
uint32 max_display_length() { return field_length; }
|
||||
friend class Create_field;
|
||||
|
|
@ -2468,10 +2471,9 @@ public:
|
|||
packlength= 4;
|
||||
if (set_packlength)
|
||||
{
|
||||
uint32 l_char_length= len_arg/cs->mbmaxlen;
|
||||
packlength= l_char_length <= 255 ? 1 :
|
||||
l_char_length <= 65535 ? 2 :
|
||||
l_char_length <= 16777215 ? 3 : 4;
|
||||
packlength= len_arg <= 255 ? 1 :
|
||||
len_arg <= 65535 ? 2 :
|
||||
len_arg <= 16777215 ? 3 : 4;
|
||||
}
|
||||
}
|
||||
Field_blob(uint32 packlength_arg)
|
||||
|
|
|
|||
15
sql/item.cc
15
sql/item.cc
|
|
@ -272,9 +272,6 @@ bool Item::get_date_with_conversion(MYSQL_TIME *ltime, ulonglong fuzzydate)
|
|||
*/
|
||||
String *Item::val_str_ascii(String *str)
|
||||
{
|
||||
if (!(collation.collation->state & MY_CS_NONASCII))
|
||||
return val_str(str);
|
||||
|
||||
DBUG_ASSERT(str != &str_value);
|
||||
|
||||
uint errors;
|
||||
|
|
@ -282,10 +279,14 @@ String *Item::val_str_ascii(String *str)
|
|||
if (!res)
|
||||
return 0;
|
||||
|
||||
if ((null_value= str->copy(res->ptr(), res->length(),
|
||||
collation.collation, &my_charset_latin1,
|
||||
&errors)))
|
||||
return 0;
|
||||
if (!(res->charset()->state & MY_CS_NONASCII))
|
||||
str= res;
|
||||
else
|
||||
{
|
||||
if ((null_value= str->copy(res->ptr(), res->length(), collation.collation,
|
||||
&my_charset_latin1, &errors)))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2939,12 +2939,13 @@ bool Item_func_min_max::get_date(MYSQL_TIME *ltime, ulonglong fuzzy_date)
|
|||
}
|
||||
unpack_time(min_max, ltime);
|
||||
|
||||
if (compare_as_dates->field_type() == MYSQL_TYPE_DATE)
|
||||
enum_field_types ftype= compare_as_dates->field_type();
|
||||
if (ftype == MYSQL_TYPE_DATE || ftype == MYSQL_TYPE_NEWDATE)
|
||||
{
|
||||
ltime->time_type= MYSQL_TIMESTAMP_DATE;
|
||||
ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0;
|
||||
}
|
||||
else if (compare_as_dates->field_type() == MYSQL_TYPE_TIME)
|
||||
else if (ftype == MYSQL_TYPE_TIME)
|
||||
{
|
||||
ltime->time_type= MYSQL_TIMESTAMP_TIME;
|
||||
ltime->hour+= (ltime->month * 32 + ltime->day) * 24;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2003-2007 MySQL AB, 2009, 2010 Sun Microsystems, Inc.
|
||||
Use is subject to license terms.
|
||||
/* Copyright (c) 2003, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -936,9 +936,8 @@ void Item_func_monthname::fix_length_and_dec()
|
|||
{
|
||||
THD* thd= current_thd;
|
||||
CHARSET_INFO *cs= thd->variables.collation_connection;
|
||||
uint32 repertoire= my_charset_repertoire(cs);
|
||||
locale= thd->variables.lc_time_names;
|
||||
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
|
||||
collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire());
|
||||
decimals=0;
|
||||
max_length= locale->max_month_name_length * collation.collation->mbmaxlen;
|
||||
maybe_null=1;
|
||||
|
|
@ -1083,9 +1082,8 @@ void Item_func_dayname::fix_length_and_dec()
|
|||
{
|
||||
THD* thd= current_thd;
|
||||
CHARSET_INFO *cs= thd->variables.collation_connection;
|
||||
uint32 repertoire= my_charset_repertoire(cs);
|
||||
locale= thd->variables.lc_time_names;
|
||||
collation.set(cs, DERIVATION_COERCIBLE, repertoire);
|
||||
collation.set(cs, DERIVATION_COERCIBLE, locale->repertoire());
|
||||
decimals=0;
|
||||
max_length= locale->max_day_name_length * collation.collation->mbmaxlen;
|
||||
maybe_null=1;
|
||||
|
|
|
|||
|
|
@ -47,12 +47,9 @@ SYM_GROUP sym_group_rtree= {"RTree keys", "HAVE_RTREE_KEYS"};
|
|||
|
||||
static SYMBOL symbols[] = {
|
||||
{ "&&", SYM(AND_AND_SYM)},
|
||||
{ "<", SYM(LT)},
|
||||
{ "<=", SYM(LE)},
|
||||
{ "<>", SYM(NE)},
|
||||
{ "!=", SYM(NE)},
|
||||
{ "=", SYM(EQ)},
|
||||
{ ">", SYM(GT_SYM)},
|
||||
{ ">=", SYM(GE)},
|
||||
{ "<<", SYM(SHIFT_LEFT)},
|
||||
{ ">>", SYM(SHIFT_RIGHT)},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2005, 2012, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2012, Monty Program Ab
|
||||
/* Copyright (c) 2005, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, Monty Program Ab
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -9738,9 +9738,6 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
/*
|
||||
When the open and locking succeeded, we check all tables to
|
||||
ensure that they still have the correct type.
|
||||
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST.
|
||||
*/
|
||||
|
||||
{
|
||||
|
|
@ -9759,10 +9756,37 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
NOTE: The base tables are added here are removed when
|
||||
close_thread_tables is called.
|
||||
*/
|
||||
RPL_TABLE_LIST *ptr= rgi->tables_to_lock;
|
||||
for (uint i= 0 ; ptr && (i < rgi->tables_to_lock_count);
|
||||
ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
|
||||
TABLE_LIST *table_list_ptr= rgi->tables_to_lock;
|
||||
for (uint i=0 ; table_list_ptr && (i < rgi->tables_to_lock_count);
|
||||
table_list_ptr= table_list_ptr->next_global, i++)
|
||||
{
|
||||
/*
|
||||
Below if condition takes care of skipping base tables that
|
||||
make up the MERGE table (which are added by open_tables()
|
||||
call). They are added next to the merge table in the list.
|
||||
For eg: If RPL_TABLE_LIST is t3->t1->t2 (where t1 and t2
|
||||
are base tables for merge table 't3'), open_tables will modify
|
||||
the list by adding t1 and t2 again immediately after t3 in the
|
||||
list (*not at the end of the list*). New table_to_lock list will
|
||||
look like t3->t1'->t2'->t1->t2 (where t1' and t2' are TABLE_LIST
|
||||
objects added by open_tables() call). There is no flag(or logic) in
|
||||
open_tables() that can skip adding these base tables to the list.
|
||||
So the logic here should take care of skipping them.
|
||||
|
||||
tables_to_lock_count logic will take care of skipping base tables
|
||||
that are added at the end of the list.
|
||||
For eg: If RPL_TABLE_LIST is t1->t2->t3, open_tables will modify
|
||||
the list into t1->t2->t3->t1'->t2'. t1' and t2' will be skipped
|
||||
because tables_to_lock_count logic in this for loop.
|
||||
*/
|
||||
if (table_list_ptr->parent_l)
|
||||
continue;
|
||||
/*
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
|
||||
skipped above).
|
||||
*/
|
||||
RPL_TABLE_LIST *ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr);
|
||||
DBUG_ASSERT(ptr->m_tabledef_valid);
|
||||
TABLE *conv_table;
|
||||
if (!ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table))
|
||||
|
|
@ -9804,6 +9828,12 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
TABLE_LIST *ptr= rgi->tables_to_lock;
|
||||
for (uint i=0 ; ptr && (i < rgi->tables_to_lock_count); ptr= ptr->next_global, i++)
|
||||
{
|
||||
/*
|
||||
Please see comment in above 'for' loop to know the reason
|
||||
for this if condition
|
||||
*/
|
||||
if (ptr->parent_l)
|
||||
continue;
|
||||
rgi->m_table_map.set_table(ptr->table_id, ptr->table);
|
||||
/*
|
||||
Following is passing flag about triggers on the server. The problem was
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2007, 2013, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2007, 2016, Oracle and/or its affiliates.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -121,16 +121,25 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
|
|||
/*
|
||||
When the open and locking succeeded, we check all tables to
|
||||
ensure that they still have the correct type.
|
||||
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST.
|
||||
*/
|
||||
|
||||
{
|
||||
RPL_TABLE_LIST *ptr= rgi->tables_to_lock;
|
||||
for (uint i= 0 ; ptr&& (i< rgi->tables_to_lock_count);
|
||||
ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
|
||||
TABLE_LIST *table_list_ptr= rgi->tables_to_lock;
|
||||
for (uint i=0 ; table_list_ptr&& (i< rgi->tables_to_lock_count);
|
||||
table_list_ptr= table_list_ptr->next_global, i++)
|
||||
{
|
||||
/*
|
||||
Please see comment in log_event.cc-Rows_log_event::do_apply_event()
|
||||
function for the explanation of the below if condition
|
||||
*/
|
||||
if (table_list_ptr->parent_l)
|
||||
continue;
|
||||
/*
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST(or child table which is
|
||||
skipped above).
|
||||
*/
|
||||
RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
|
||||
DBUG_ASSERT(ptr->m_tabledef_valid);
|
||||
TABLE *conv_table;
|
||||
if (!ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table))
|
||||
|
|
@ -163,7 +172,15 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
|
|||
*/
|
||||
TABLE_LIST *ptr= rgi->tables_to_lock;
|
||||
for (uint i=0; ptr && (i < rgi->tables_to_lock_count); ptr= ptr->next_global, i++)
|
||||
{
|
||||
/*
|
||||
Please see comment in log_event.cc-Rows_log_event::do_apply_event()
|
||||
function for the explanation of the below if condition
|
||||
*/
|
||||
if (ptr->parent_l)
|
||||
continue;
|
||||
rgi->m_table_map.set_table(ptr->table_id, ptr->table);
|
||||
}
|
||||
#ifdef HAVE_QUERY_CACHE
|
||||
query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock);
|
||||
#endif
|
||||
|
|
@ -1518,16 +1535,25 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
|
|||
/*
|
||||
When the open and locking succeeded, we check all tables to
|
||||
ensure that they still have the correct type.
|
||||
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST.
|
||||
*/
|
||||
|
||||
{
|
||||
RPL_TABLE_LIST *ptr= rgi->tables_to_lock;
|
||||
for (uint i= 0 ; ptr&& (i< rgi->tables_to_lock_count);
|
||||
ptr= static_cast<RPL_TABLE_LIST*>(ptr->next_global), i++)
|
||||
TABLE_LIST *table_list_ptr= rgi->tables_to_lock;
|
||||
for (uint i=0; table_list_ptr&& (i< rgi->tables_to_lock_count);
|
||||
table_list_ptr= static_cast<RPL_TABLE_LIST*>(table_list_ptr->next_global), i++)
|
||||
{
|
||||
/*
|
||||
Please see comment in log_event.cc-Rows_log_event::do_apply_event()
|
||||
function for the explanation of the below if condition
|
||||
*/
|
||||
if (table_list_ptr->parent_l)
|
||||
continue;
|
||||
/*
|
||||
We can use a down cast here since we know that every table added
|
||||
to the tables_to_lock is a RPL_TABLE_LIST (or child table which is
|
||||
skipped above).
|
||||
*/
|
||||
RPL_TABLE_LIST *ptr=static_cast<RPL_TABLE_LIST*>(table_list_ptr);
|
||||
TABLE *conv_table;
|
||||
if (ptr->m_tabledef.compatible_with(thd, rgi, ptr->table, &conv_table))
|
||||
{
|
||||
|
|
|
|||
11
sql/slave.cc
11
sql/slave.cc
|
|
@ -1,5 +1,5 @@
|
|||
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
|
||||
Copyright (c) 2008, 2015, MariaDB
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -4292,7 +4292,8 @@ int check_temp_dir(char* tmp_file)
|
|||
mysql_mutex_lock(&LOCK_thread_count);
|
||||
if (check_temp_dir_run)
|
||||
{
|
||||
result= check_temp_dir_result;
|
||||
if ((result= check_temp_dir_result))
|
||||
my_message(result, tmp_file, MYF(0));
|
||||
goto end;
|
||||
}
|
||||
check_temp_dir_run= 1;
|
||||
|
|
@ -4327,7 +4328,6 @@ int check_temp_dir(char* tmp_file)
|
|||
mysql_file_delete(key_file_misc, tmp_file, MYF(0));
|
||||
|
||||
end:
|
||||
check_temp_dir_result= result;
|
||||
mysql_mutex_unlock(&LOCK_thread_count);
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
|
@ -4603,11 +4603,14 @@ log '%s' at position %s, relay log '%s' position: %s%s", RPL_LOG_NAME,
|
|||
|
||||
if (check_temp_dir(rli->slave_patternload_file))
|
||||
{
|
||||
check_temp_dir_result= thd->get_stmt_da()->sql_errno();
|
||||
rli->report(ERROR_LEVEL, thd->get_stmt_da()->sql_errno(), NULL,
|
||||
"Unable to use slave's temporary directory %s - %s",
|
||||
slave_load_tmpdir, thd->get_stmt_da()->message());
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
check_temp_dir_result= 0;
|
||||
|
||||
/* Load the set of seen GTIDs, if we did not already. */
|
||||
if (rpl_load_gtid_slave_state(thd))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 2000, 2010, Oracle and/or its affiliates.
|
||||
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2009, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Copyright (c) 2002, 2013, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2013, Monty Program Ab
|
||||
Copyright (c) 2002, 2016, Oracle and/or its affiliates.
|
||||
Copyright (c) 2011, 2016, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -514,8 +514,10 @@ sp_name::init_qname(THD *thd)
|
|||
bool
|
||||
check_routine_name(LEX_STRING *ident)
|
||||
{
|
||||
if (!ident || !ident->str || !ident->str[0] ||
|
||||
ident->str[ident->length-1] == ' ')
|
||||
DBUG_ASSERT(ident);
|
||||
DBUG_ASSERT(ident->str);
|
||||
|
||||
if (!ident->str[0] || ident->str[ident->length-1] == ' ')
|
||||
{
|
||||
my_error(ER_SP_WRONG_NAME, MYF(0), ident->str);
|
||||
return TRUE;
|
||||
|
|
|
|||
|
|
@ -1479,32 +1479,35 @@ static int lex_one_token(YYSTYPE *yylval, THD *thd)
|
|||
return (BIN_NUM);
|
||||
|
||||
case MY_LEX_CMP_OP: // Incomplete comparison operator
|
||||
lip->next_state= MY_LEX_START; // Allow signed numbers
|
||||
if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP ||
|
||||
state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
|
||||
lip->yySkip();
|
||||
if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
|
||||
{
|
||||
lip->next_state= MY_LEX_START; // Allow signed numbers
|
||||
return(tokval);
|
||||
lip->yySkip();
|
||||
if ((tokval= find_keyword(lip, 2, 0)))
|
||||
return(tokval);
|
||||
lip->yyUnget();
|
||||
}
|
||||
state = MY_LEX_CHAR; // Something fishy found
|
||||
break;
|
||||
return(c);
|
||||
|
||||
case MY_LEX_LONG_CMP_OP: // Incomplete comparison operator
|
||||
lip->next_state= MY_LEX_START;
|
||||
if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP ||
|
||||
state_map[(uchar) lip->yyPeek()] == MY_LEX_LONG_CMP_OP)
|
||||
{
|
||||
lip->yySkip();
|
||||
if (state_map[(uchar) lip->yyPeek()] == MY_LEX_CMP_OP)
|
||||
{
|
||||
lip->yySkip();
|
||||
if ((tokval= find_keyword(lip, 3, 0)))
|
||||
return(tokval);
|
||||
lip->yyUnget();
|
||||
}
|
||||
if ((tokval= find_keyword(lip, 2, 0)))
|
||||
return(tokval);
|
||||
lip->yyUnget();
|
||||
}
|
||||
if ((tokval = find_keyword(lip, lip->yyLength() + 1, 0)))
|
||||
{
|
||||
lip->next_state= MY_LEX_START; // Found long op
|
||||
return(tokval);
|
||||
}
|
||||
state = MY_LEX_CHAR; // Something fishy found
|
||||
break;
|
||||
return(c);
|
||||
|
||||
case MY_LEX_BOOL:
|
||||
if (c != lip->yyPeek())
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue