Merge 10.2 into 10.2-mdev9864.

This commit is contained in:
Igor Babaev 2016-08-30 16:14:51 -07:00
commit 2250e9ea26
1739 changed files with 87430 additions and 36812 deletions

3
.gitattributes vendored
View file

@ -9,6 +9,7 @@
*.cpp text
*.h text
*.test text
*.java text
# These files should be checked out as is
*.result -text -whitespace
@ -23,9 +24,11 @@ pcre/testdata/greppatN4 -text
*.frm binary
*.MYD binary
*.MYI binary
*.class binary
*.c diff=cpp
*.h diff=cpp
*.cc diff=cpp
*.ic diff=cpp
*.cpp diff=cpp
*.java diff=cpp

2
.gitignore vendored
View file

@ -244,6 +244,8 @@ storage/mroonga/mysql-test/mroonga/storage/r/variable_version.result
*.exp
*.dep
*.idb
*.res
*.tlog
# Precompiled Headers
*.gch

56
.travis.yml Normal file
View file

@ -0,0 +1,56 @@
# vim ft=yaml
# travis-ci.org definition
# non-container builds don't have enough RAM to reliably compile
sudo: required
dist: trusty
language: cpp
compiler:
- gcc
# - clang # See commit f38808 if you want to re-enable clang builds
cache:
apt:
ccache:
# Timing on build an test needs to be < 50 minutes. The compile is ~4-5minutes
# so here we group the tests such that this happens.
addons:
apt:
packages: # make sure these match debian/control contents
- bison
- chrpath
- cmake
- debhelper
- dh-apparmor
- dpatch
- libaio-dev
- libboost-dev
- libjudy-dev
- libncurses5-dev
- libpam0g-dev
- libreadline-gplv2-dev
- libssl-dev
- lsb-release
- perl
- po-debconf
- psmisc
- zlib1g-dev
- libcrack2-dev # no effect as the package is disallowed on Travis-CI
- libjemalloc-dev
- devscripts # implicit for any build on Ubuntu
script:
- ${CC} --version ; ${CXX} --version
- cd "${TRAVIS_BUILD_DIR}"
- env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
notifications:
irc:
channels:
- "chat.freenode.net#maria"
on_success: never # [always|never|change]
on_failure: never
template:
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"

View file

@ -153,6 +153,7 @@ INCLUDE(plugin)
INCLUDE(install_macros)
INCLUDE(systemd)
INCLUDE(mysql_add_executable)
INCLUDE(crc32-vpmsum)
# Handle options
OPTION(DISABLE_SHARED

View file

@ -1,3 +1,3 @@
MYSQL_VERSION_MAJOR=10
MYSQL_VERSION_MINOR=2
MYSQL_VERSION_PATCH=0
MYSQL_VERSION_PATCH=2

View file

@ -1,5 +1,6 @@
/*
Copyright (c) 2001, 2012, 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

View file

@ -1,7 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
Copyright (c) 2013, 2014, SkySQL Ab
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
@ -96,9 +95,16 @@ extern "C" {
#endif
}
#if !defined(HAVE_VIDATTR)
#undef vidattr
#define vidattr(A) {} // Can't get this to work
#ifdef HAVE_VIDATTR
static int have_curses= 0;
static void my_vidattr(chtype attrs)
{
if (have_curses)
vidattr(attrs);
}
#else
#undef HAVE_SETUPTERM
#define my_vidattr(A) {} // Can't get this to work
#endif
#ifdef FN_NO_CASE_SENSE
@ -4734,9 +4740,9 @@ com_status(String *buffer __attribute__((unused)),
if (skip_updates)
{
vidattr(A_BOLD);
my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nAll updates ignored to this database\n");
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
}
#ifdef USE_POPEN
tee_fprintf(stdout, "Current pager:\t\t%s\n", pager);
@ -4804,9 +4810,9 @@ com_status(String *buffer __attribute__((unused)),
}
if (safe_updates)
{
vidattr(A_BOLD);
my_vidattr(A_BOLD);
tee_fprintf(stdout, "\nNote that you are running in safe_update_mode:\n");
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
tee_fprintf(stdout, "\
UPDATEs and DELETEs that don't use a key in the WHERE clause are not allowed.\n\
(One can force an UPDATE/DELETE by adding LIMIT # at the end of the command.)\n\
@ -4899,10 +4905,11 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
{
if (!inited)
{
inited=1;
#ifdef HAVE_SETUPTERM
(void) setupterm((char *)0, 1, (int *) 0);
int errret;
have_curses= setupterm((char *)0, 1, &errret) != ERR;
#endif
inited=1;
}
if (info_type == INFO_ERROR)
{
@ -4914,7 +4921,7 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
putchar('\a'); /* This should make a bell */
#endif
}
vidattr(A_STANDOUT);
my_vidattr(A_STANDOUT);
if (error)
{
if (sqlstate)
@ -4933,9 +4940,9 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate)
tee_fputs(": ", file);
}
else
vidattr(A_BOLD);
my_vidattr(A_BOLD);
(void) tee_puts(str, file);
vidattr(A_NORMAL);
my_vidattr(A_NORMAL);
}
if (unbuffered)
fflush(file);

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2006, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2014, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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
@ -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;
}

View file

@ -34,6 +34,7 @@
#define TABLE TABLE_CLIENT
#include "client_priv.h"
#include <my_time.h>
#include <sslopt-vars.h>
/* That one is necessary for defines of OPTION_NO_FOREIGN_KEY_CHECKS etc */
#include "sql_priv.h"
#include "log_event.h"
@ -1403,6 +1404,7 @@ static struct my_option my_options[] =
{"socket", 'S', "The socket file to use for connection.",
&sock, &sock, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0,
0, 0},
#include <sslopt-longopts.h>
{"start-datetime", OPT_START_DATETIME,
"Start reading the binlog at first event having a datetime equal or "
"posterior to the argument; the argument must be a date and time "
@ -1621,6 +1623,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
DBUG_PUSH(argument ? argument : default_dbug_option);
break;
#endif
#include <sslopt-case.h>
case 'd':
one_database = 1;
break;
@ -1773,6 +1776,18 @@ static Exit_status safe_connect()
return ERROR_STOP;
}
#ifdef HAVE_OPENSSL
if (opt_use_ssl)
{
mysql_ssl_set(mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
mysql_options(mysql, MYSQL_OPT_SSL_CRL, opt_ssl_crl);
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, opt_ssl_crlpath);
}
mysql_options(mysql,MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
(char*)&opt_ssl_verify_server_cert);
#endif /*HAVE_OPENSSL*/
if (opt_plugindir && *opt_plugindir)
mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugindir);

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2001, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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
@ -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));
@ -871,7 +874,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");
@ -924,10 +927,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);
@ -943,7 +948,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);
@ -1209,7 +1214,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");

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, Monty Program Ab.
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
@ -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);
@ -896,7 +896,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)
{
@ -906,7 +906,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);
@ -1177,8 +1177,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);
@ -1311,7 +1311,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)
{
@ -1527,7 +1527,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,
@ -1727,14 +1727,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);
@ -1868,7 +1868,7 @@ static char *quote_for_equal(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;
@ -2129,7 +2129,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;
@ -2246,7 +2246,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,
@ -2366,7 +2366,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);
@ -2459,7 +2458,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,
@ -2517,9 +2516,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",
@ -4107,7 +4106,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"
@ -4120,7 +4119,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);
@ -4150,7 +4149,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, "',");
@ -5418,7 +5417,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;
@ -5476,7 +5475,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);
@ -5732,8 +5731,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);
@ -6120,7 +6119,7 @@ int main(int argc, char **argv)
goto err;
/*
No reason to explicitely COMMIT the transaction, neither to explicitely
No reason to explicitly COMMIT the transaction, neither to explicitly
UNLOCK TABLES: these will be automatically be done by the server when we
disconnect now. Saves some code here, some network trips, adds nothing to
server.

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2011, 2015, MariaDB
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

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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
@ -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;

View file

@ -1,6 +1,6 @@
/*
Copyright (c) 2005, 2015, Oracle and/or its affiliates.
Copyright (c) 2010, 2015, MariaDB
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

View file

@ -1,5 +1,5 @@
/* Copyright (c) 2000, 2013, Oracle and/or its affiliates.
Copyright (c) 2009, 2013, Monty Program Ab.
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
@ -1027,7 +1027,7 @@ static void init_connection_thd(struct st_connection *cn)
cn->has_thread=TRUE;
}
#else /*EMBEDDED_LIBRARY*/
#else /* ! EMBEDDED_LIBRARY*/
#define init_connection_thd(X) do { } while(0)
#define do_send_query(cn,q,q_len) mysql_send_query(cn->mysql, q, q_len)
@ -6526,7 +6526,7 @@ int read_line(char *buf, int size)
start_lineno));
}
/* Skip all space at begining of line */
/* Skip all space at beginning of line */
skip_char= 1;
}
else if (end_of_query(c))
@ -6538,10 +6538,10 @@ int read_line(char *buf, int size)
}
else if (c == '}')
{
/* A "}" need to be by itself in the begining of a line to terminate */
/* A "}" need to be by itself in the beginning of a line to terminate */
*p++= c;
*p= 0;
DBUG_PRINT("exit", ("Found '}' in begining of a line at line: %d",
DBUG_PRINT("exit", ("Found '}' in beginning of a line at line: %d",
cur_file->lineno));
DBUG_RETURN(0);
}

View file

@ -15,7 +15,7 @@ SET(fail_patterns
)
MACRO (MY_CHECK_C_COMPILER_FLAG flag)
STRING(REGEX REPLACE "[-,= ]" "_" result "have_C_${flag}")
STRING(REGEX REPLACE "[-,= +]" "_" result "have_C_${flag}")
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
@ -24,7 +24,7 @@ MACRO (MY_CHECK_C_COMPILER_FLAG flag)
ENDMACRO()
MACRO (MY_CHECK_CXX_COMPILER_FLAG flag)
STRING(REGEX REPLACE "[-,= ]" "_" result "have_CXX_${flag}")
STRING(REGEX REPLACE "[-,= +]" "_" result "have_CXX_${flag}")
SET(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}")
CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${result}
@ -40,7 +40,7 @@ FUNCTION(MY_CHECK_AND_SET_COMPILER_FLAG flag)
ENDIF()
MY_CHECK_C_COMPILER_FLAG(${flag})
MY_CHECK_CXX_COMPILER_FLAG(${flag})
STRING(REGEX REPLACE "[-,= ]" "_" result "${flag}")
STRING(REGEX REPLACE "[-,= +]" "_" result "${flag}")
FOREACH(lang C CXX)
IF (have_${lang}_${result})
IF(ARGN)

View file

@ -24,7 +24,3 @@ IF(GETCONF)
OUTPUT_VARIABLE CPU_LEVEL1_DCACHE_LINESIZE
)
ENDIF()
IF(CPU_LEVEL1_DCACHE_LINESIZE AND CPU_LEVEL1_DCACHE_LINESIZE GREATER 0)
ELSE()
SET(CPU_LEVEL1_DCACHE_LINESIZE 64)
ENDIF()

5
cmake/crc32-vpmsum.cmake Normal file
View file

@ -0,0 +1,5 @@
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
SET(HAVE_CRC32_VPMSUM 1)
SET(CRC32_VPMSUM_LIBRARY crc32-vpmsum)
ADD_SUBDIRECTORY(extra/crc32-vpmsum)
ENDIF()

View file

@ -50,7 +50,7 @@ IF(CMAKE_C_COMPILER MATCHES "icl")
ENDIF()
ADD_DEFINITIONS(-D_WINDOWS -D__WIN__ -D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0600)
# We do not want the windows.h macros min/max
ADD_DEFINITIONS(-DNOMINMAX)
# Speed up build process excluding unused header files

View file

@ -209,11 +209,16 @@ MACRO(MYSQL_ADD_PLUGIN)
IF(ARG_COMPONENT)
IF(CPACK_COMPONENTS_ALL AND
NOT CPACK_COMPONENTS_ALL MATCHES ${ARG_COMPONENT})
IF (ARG_STORAGE_ENGINE)
SET(ver " = %{version}-%{release}")
ELSE()
SET(ver "")
ENDIF()
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} ${ARG_COMPONENT})
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
IF (NOT ARG_CLIENT)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB" PARENT_SCOPE)
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE)
ENDIF()
# workarounds for cmake issues #13248 and #12864:
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)

View file

@ -55,9 +55,10 @@ MACRO(CHECK_SYSTEMD)
IF(HAVE_SYSTEMD AND HAVE_SYSTEMD_SD_DAEMON_H AND HAVE_SYSTEMD_SD_LISTEN_FDS
AND HAVE_SYSTEMD_SD_NOTIFY AND HAVE_SYSTEMD_SD_NOTIFYF)
ADD_DEFINITIONS(-DHAVE_SYSTEMD)
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster)
SET(SYSTEMD_SCRIPTS mariadb-service-convert galera_new_cluster galera_recovery)
SET(SYSTEMD_DEB_FILES "usr/bin/mariadb-service-convert
usr/bin/galera_new_cluster
usr/bin/galera_recovery
${INSTALL_SYSTEMD_UNITDIR}/mariadb.service
${INSTALL_SYSTEMD_UNITDIR}/mariadb@.service
${INSTALL_SYSTEMD_UNITDIR}/mariadb@bootstrap.service.d/use_galera_new_cluster.conf")

View file

@ -105,6 +105,8 @@
/* Libraries */
#cmakedefine HAVE_LIBWRAP 1
#cmakedefine HAVE_SYSTEMD 1
#cmakedefine HAVE_CRC32_VPMSUM 1
/* Does "struct timespec" have a "sec" and "nsec" field? */
#cmakedefine HAVE_TIMESPEC_TS_SEC 1

View file

@ -10,10 +10,16 @@ set -e
# Debug script and command lines
#set -x
# Don't run the mysql-test-run test suite as part of build.
# On Buildbot, don't run the mysql-test-run test suite as part of build.
# It takes a lot of time, and we will do a better test anyway in
# Buildbot, running the test suite from installed .debs on a clean VM.
export DEB_BUILD_OPTIONS="nocheck"
# On Travis-CI we want to simulate the full build, including tests.
# Also on Travis-CI it is useful not to override the DEB_BUILD_OPTIONS
# at this stage at all.
if [[ ! $TRAVIS ]]
then
export DEB_BUILD_OPTIONS="nocheck"
fi
export MARIADB_OPTIONAL_DEBS=""
@ -32,8 +38,8 @@ LOGSTRING="MariaDB build"
CODENAME="$(lsb_release -sc)"
# add libcrack2 (>= 2.9.0) as a build dependency
# but only where the distribution can possibly satisfy it
if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
# but only where the distribution can possibly satisfy it and if not on Travis-CI
if $TRAVIS || apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
then
# Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting
# packages by snipped in rules file

7
debian/control vendored
View file

@ -316,7 +316,7 @@ Description: MariaDB database regression test suite
Package: mariadb-server-10.2
Architecture: any
Suggests: mailx, mariadb-test, netcat-openbsd, socat, tinyca
Suggests: mailx, mariadb-test, netcat-openbsd, tinyca
Recommends: libhtml-template-perl
Pre-Depends: mariadb-common, adduser (>= 3.40), debconf
Depends: bsdutils,
@ -335,6 +335,7 @@ Depends: bsdutils,
perl (>= 5.6),
psmisc,
rsync,
socat,
tar,
${misc:Depends},
${shlibs:Depends}
@ -415,10 +416,10 @@ Description: MariaDB database regression test suite (metapackage for the latest
Package: mariadb-connect-engine-10.2
Architecture: any
Depends: libxml2, mariadb-server-10.2, unixODBC
Depends: libxml2, mariadb-server-10.2, unixodbc
Build-Depends: libxml2-dev,
mariadb-server-10.2,
unixODBC-dev,
unixodbc-dev,
${misc:Depends},
${shlibs:Depends}
Description: Connect storage engine for MariaDB

View file

@ -25,7 +25,7 @@ SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
CONF=/etc/mysql/my.cnf
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
# priority can be overriden and "-s" adds output to stderr
# priority can be overridden and "-s" adds output to stderr
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"
# Safeguard (relative paths, core dumps..)

View file

@ -239,7 +239,7 @@ db_stop # in case invoke failes
# dh_systemd_start doesn't emit anything since we still ship /etc/init.d/mysql.
# Thus MariaDB server is started via init.d script, which in turn redirects to
# systemctl. If we upgrade from MySQL mysql.service may be masked, which also
# means init.d script is disabled. Unmask mysql service explicitely.
# means init.d script is disabled. Unmask mysql service explicitly.
# Check first that the command exists, to avoid emitting any warning messages.
if [ -x "$(command -v deb-systemd-helper)" ]; then
deb-systemd-helper unmask mysql.service > /dev/null

View file

@ -44,8 +44,6 @@ usr/share/mysql/mysql-test/suite/jp/r
usr/share/mysql/mysql-test/suite/jp/include
usr/share/mysql/mysql-test/suite/jp/std_data
usr/share/mysql/mysql-test/suite/maria
usr/share/mysql/mysql-test/suite/maria/t
usr/share/mysql/mysql-test/suite/maria/r
usr/share/mysql/mysql-test/suite/funcs_2
usr/share/mysql/mysql-test/suite/funcs_2/lib
usr/share/mysql/mysql-test/suite/funcs_2/t

19
debian/rules vendored
View file

@ -29,20 +29,15 @@ ifeq (${MAKE_J}, -j0)
MAKE_J = -j1
endif
MAKE_TEST_TARGET=test-force
ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),)
# make test-bt is the testsuite run by the MySQL build team
# before a release, but it is long
MAKE_TEST_TARGET=test-bt
# Parallel build support as advised
# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j $(NUMJOBS)
endif
USE_ASSEMBLER=--enable-assembler
ifneq (,$(filter $(ARCH), amd64 i386 ia64 s390))
TESTSUITE_FAIL_CMD=exit 1
else
TESTSUITE_FAIL_CMD=true
endif
USE_ASSEMBLER=--enable-assembler
BUILDDIR = builddir
builddir = $(BUILDDIR)
@ -88,7 +83,7 @@ build-stamp: configure
ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
if [ ! -f testsuite-stamp ] ; then \
cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; \
cd $(builddir)/mysql-test && ./mtr --force --parallel=$(NUMJOBS) --skip-rpl --suite=main; \
fi
endif

View file

@ -80,13 +80,6 @@ IF(WITH_INNOBASE_STORAGE_ENGINE OR WITH_XTRADB_STORAGE_ENGINE)
../storage/innobase/page/page0zip.cc
)
IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le")
enable_language(ASM)
LIST(APPEND INNOBASE_SOURCES
../storage/innobase/ut/crc32_power8/crc32.S
../storage/innobase/ut/crc32_power8/crc32_wrapper.c
)
ENDIF()
MYSQL_ADD_EXECUTABLE(innochecksum innochecksum.cc ${INNOBASE_SOURCES})
TARGET_LINK_LIBRARIES(innochecksum mysys mysys_ssl)

View file

@ -327,7 +327,8 @@ static int create_sys_files(struct languages *lang_head,
uint error_count)
{
FILE *to;
uint csnum= 0, length, i, row_nr;
uint csnum= 0, i, row_nr;
ulong length;
uchar head[HEADER_LENGTH];
char outfile[FN_REFLEN], *outfile_end;
long start_pos;
@ -397,8 +398,8 @@ static int create_sys_files(struct languages *lang_head,
DBUG_ASSERT(error_count == row_nr);
/* continue with header of the errmsg.sys file */
length= (my_ftell(to, MYF(0)) - HEADER_LENGTH -
(error_count + section_count) * 2);
length= (ulong) (my_ftell(to, MYF(0)) - HEADER_LENGTH -
(error_count + section_count) * 2);
bzero((uchar*) head, HEADER_LENGTH);
bmove((uchar*) head, (uchar*) file_head, 4);
head[4]= 1;

View file

@ -0,0 +1,2 @@
ENABLE_LANGUAGE(ASM)
ADD_CONVENIENCE_LIBRARY(${CRC32_VPMSUM_LIBRARY} crc32c.S crc32c_wrapper.c crc32ieee.S crc32ieee_wrapper.c)

View file

@ -46,19 +46,8 @@
/* byte reverse permute constant */
.octa 0x0F0E0D0C0B0A09080706050403020100
#define __ASSEMBLY__
#include "crc32_constants.h"
.text
#if defined(__BIG_ENDIAN__) && defined(REFLECT)
#define BYTESWAP_DATA
#elif defined(__LITTLE_ENDIAN__) && !defined(REFLECT)
#define BYTESWAP_DATA
#else
#undef BYTESWAP_DATA
#endif
#define off16 r25
#define off32 r26
#define off48 r27
@ -82,7 +71,7 @@
#endif
/* unsigned int __crc32_vpmsum(unsigned int crc, void *p, unsigned long len) */
FUNC_START(__crc32_vpmsum)
FUNC_START(__F)
std r31,-8(r1)
std r30,-16(r1)
std r29,-24(r1)
@ -126,19 +115,14 @@ FUNC_START(__crc32_vpmsum)
/* Get the initial value into v8 */
vxor v8,v8,v8
MTVRD(v8, r3)
#ifdef REFLECT
vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */
#else
vsldoi v8,v8,zeroes,4 /* shift into top 32 bits */
#endif
#ifdef BYTESWAP_DATA
vsldoi v8,zeroes,v8,8 /* shift into bottom 32 bits */
addis r3,r2,.byteswap_constant@toc@ha
addi r3,r3,.byteswap_constant@toc@l
lvx byteswap,0,r3
addi r3,r3,16
#endif
cmpdi r5,256
blt .Lshort
@ -170,8 +154,8 @@ FUNC_START(__crc32_vpmsum)
addi r7,r7,-1
mtctr r7
addis r3,r2,.constants@toc@ha
addi r3,r3,.constants@toc@l
addis r3,r2,CONSTANTS@toc@ha
addi r3,r3,CONSTANTS@toc@l
/* Find the start of our constants */
add r3,r3,r8
@ -376,7 +360,6 @@ FUNC_START(__crc32_vpmsum)
vxor v6,v6,v14
vxor v7,v7,v15
#ifdef REFLECT
/*
* vpmsumd produces a 96 bit result in the least significant bits
* of the register. Since we are bit reflected we have to shift it
@ -391,7 +374,6 @@ FUNC_START(__crc32_vpmsum)
vsldoi v5,v5,zeroes,4
vsldoi v6,v6,zeroes,4
vsldoi v7,v7,zeroes,4
#endif
/* xor with last 1024 bits */
lvx v8,0,r4
@ -526,8 +508,8 @@ FUNC_START(__crc32_vpmsum)
.Lbarrett_reduction:
/* Barrett constants */
addis r3,r2,.barrett_constants@toc@ha
addi r3,r3,.barrett_constants@toc@l
addis r3,r2,BARRETT_CONSTANTS@toc@ha
addi r3,r3,BARRETT_CONSTANTS@toc@l
lvx const1,0,r3
lvx const2,off16,r3
@ -535,33 +517,12 @@ FUNC_START(__crc32_vpmsum)
vsldoi v1,v0,v0,8
vxor v0,v0,v1 /* xor two 64 bit results together */
#ifdef REFLECT
/* shift left one bit */
vspltisb v1,1
vsl v0,v0,v1
#endif
vand v0,v0,mask_64bit
#ifndef REFLECT
/*
* Now for the Barrett reduction algorithm. The idea is to calculate q,
* the multiple of our polynomial that we need to subtract. By
* doing the computation 2x bits higher (ie 64 bits) and shifting the
* result back down 2x bits, we round down to the nearest multiple.
*/
VPMSUMD(v1,v0,const1) /* ma */
vsldoi v1,zeroes,v1,8 /* q = floor(ma/(2^64)) */
VPMSUMD(v1,v1,const2) /* qn */
vxor v0,v0,v1 /* a - qn, subtraction is xor in GF(2) */
/*
* Get the result into r3. We need to shift it left 8 bytes:
* V0 [ 0 1 2 X ]
* V0 [ 0 X 2 3 ]
*/
vsldoi v0,v0,zeroes,8 /* shift result into top 64 bits */
#else
/*
* The reflected version of Barrett reduction. Instead of bit
* reflecting our data (which is expensive to do), we bit reflect our
@ -582,7 +543,6 @@ FUNC_START(__crc32_vpmsum)
* V0 [ 0 X 2 3 ]
*/
vsldoi v0,v0,zeroes,4 /* shift result into top 64 bits of */
#endif
.Lout:
subi r6,r1,56+10*16
@ -631,8 +591,8 @@ FUNC_START(__crc32_vpmsum)
cmpdi r5,0
beq .Lzero
addis r3,r2,.short_constants@toc@ha
addi r3,r3,.short_constants@toc@l
addis r3,r2,SHORT_CONSTANTS@toc@ha
addi r3,r3,SHORT_CONSTANTS@toc@l
/* Calculate where in the constant table we need to start */
subfic r6,r5,256
@ -767,9 +727,8 @@ FUNC_START(__crc32_vpmsum)
.Lzero:
mr r3,r10
blr
b .Lout
FUNC_END(__crc32_vpmsum)
FUNC_END(__F)
#endif /* __powerpc__ */

View file

@ -1,12 +1,9 @@
#ifdef __powerpc__
#define CRC_TABLE
#include "crc32_constants.h"
#define VMX_ALIGN 16
#define VMX_ALIGN_MASK (VMX_ALIGN-1)
#ifdef REFLECT
static unsigned int crc32_align(unsigned int crc, unsigned char *p,
unsigned long len)
{
@ -14,28 +11,17 @@ static unsigned int crc32_align(unsigned int crc, unsigned char *p,
crc = crc_table[(crc ^ *p++) & 0xff] ^ (crc >> 8);
return crc;
}
#else
static unsigned int crc32_align(unsigned int crc, unsigned char *p,
unsigned long len)
{
while (len--)
crc = crc_table[((crc >> 24) ^ *p++) & 0xff] ^ (crc << 8);
return crc;
}
#endif
unsigned int __crc32_vpmsum(unsigned int crc, unsigned char *p,
unsigned int __F(unsigned int crc, unsigned char *p,
unsigned long len);
unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p,
unsigned int F(unsigned int crc, unsigned char *p,
unsigned long len)
{
unsigned int prealign;
unsigned int tail;
#ifdef CRC_XOR
crc ^= 0xffffffff;
#endif
if (len < VMX_ALIGN + VMX_ALIGN_MASK) {
crc = crc32_align(crc, p, len);
@ -49,7 +35,7 @@ unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p,
p += prealign;
}
crc = __crc32_vpmsum(crc, p, len & ~VMX_ALIGN_MASK);
crc = __F(crc, p, len & ~VMX_ALIGN_MASK);
tail = len & VMX_ALIGN_MASK;
if (tail) {
@ -58,9 +44,7 @@ unsigned int crc32_vpmsum(unsigned int crc, unsigned char *p,
}
out:
#ifdef CRC_XOR
crc ^= 0xffffffff;
#endif
return crc;
}

View file

@ -0,0 +1,14 @@
#ifdef __powerpc__
#define CONSTANTS .crc32c_constants
#define SHORT_CONSTANTS .crc32c_short_constants
#define BARRETT_CONSTANTS .crc32c_barrett_constants
#include "crc32c_constants.h"
#define __F __crc32c_vpmsum
#include "crc32.iS"
#endif

View file

@ -3,83 +3,10 @@
#ifdef __powerpc__
#define CRC 0x1edc6f41
#define CRC_XOR
#define REFLECT
#ifndef __ASSEMBLY__
#ifdef CRC_TABLE
static const unsigned int crc_table[] = {
0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,
0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,
0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,
0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,
0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,
0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,
0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,
0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,
0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,
0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,
0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,
0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,
0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,
0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,
0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,
0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,
0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,
0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,
0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,
0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,
0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,
0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,
0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,
0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,
0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,
0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,
0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,
0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,
0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,
0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,
0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,
0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,
0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,
0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,
0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,
0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,
0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,
0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,
0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,
0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,
0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,
0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,
0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,
0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,
0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,
0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,
0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,
0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,
0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,
0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,
0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,
0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,
0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,
0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,
0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,
0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,
0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,
0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,
0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,
0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,
0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,
0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,
0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,};
#endif
#else
#define MAX_SIZE 32768
.constants:
CONSTANTS:
/* Reduce 262144 kbits to 1024 bits */
/* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */
@ -847,7 +774,7 @@ static const unsigned int crc_table[] = {
/* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */
.octa 0x0000000171fb63ce00000001609bc4b4
.short_constants:
SHORT_CONSTANTS:
/* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */
/* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */
@ -899,12 +826,11 @@ static const unsigned int crc_table[] = {
.octa 0x82f63b786ea2d55ca66805eb18b8ea18
.barrett_constants:
BARRETT_CONSTANTS:
/* 33 bit reflected Barrett constant m - (4^32)/n */
.octa 0x000000000000000000000000dea713f1 /* x^64 div p(x)` */
/* 33 bit reflected Barrett constant n */
.octa 0x00000000000000000000000105ec76f1
#endif
#endif /* __powerpc__ */

View file

@ -0,0 +1,78 @@
#ifdef __powerpc__
#define F crc32c_vpmsum
#define __F __crc32c_vpmsum
#define CRC 0x1edc6f41
static const unsigned int crc_table[] = {
0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4,
0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb,
0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24,
0x105ec76f, 0xe235446c, 0xf165b798, 0x030e349b,
0xd7c45070, 0x25afd373, 0x36ff2087, 0xc494a384,
0x9a879fa0, 0x68ec1ca3, 0x7bbcef57, 0x89d76c54,
0x5d1d08bf, 0xaf768bbc, 0xbc267848, 0x4e4dfb4b,
0x20bd8ede, 0xd2d60ddd, 0xc186fe29, 0x33ed7d2a,
0xe72719c1, 0x154c9ac2, 0x061c6936, 0xf477ea35,
0xaa64d611, 0x580f5512, 0x4b5fa6e6, 0xb93425e5,
0x6dfe410e, 0x9f95c20d, 0x8cc531f9, 0x7eaeb2fa,
0x30e349b1, 0xc288cab2, 0xd1d83946, 0x23b3ba45,
0xf779deae, 0x05125dad, 0x1642ae59, 0xe4292d5a,
0xba3a117e, 0x4851927d, 0x5b016189, 0xa96ae28a,
0x7da08661, 0x8fcb0562, 0x9c9bf696, 0x6ef07595,
0x417b1dbc, 0xb3109ebf, 0xa0406d4b, 0x522bee48,
0x86e18aa3, 0x748a09a0, 0x67dafa54, 0x95b17957,
0xcba24573, 0x39c9c670, 0x2a993584, 0xd8f2b687,
0x0c38d26c, 0xfe53516f, 0xed03a29b, 0x1f682198,
0x5125dad3, 0xa34e59d0, 0xb01eaa24, 0x42752927,
0x96bf4dcc, 0x64d4cecf, 0x77843d3b, 0x85efbe38,
0xdbfc821c, 0x2997011f, 0x3ac7f2eb, 0xc8ac71e8,
0x1c661503, 0xee0d9600, 0xfd5d65f4, 0x0f36e6f7,
0x61c69362, 0x93ad1061, 0x80fde395, 0x72966096,
0xa65c047d, 0x5437877e, 0x4767748a, 0xb50cf789,
0xeb1fcbad, 0x197448ae, 0x0a24bb5a, 0xf84f3859,
0x2c855cb2, 0xdeeedfb1, 0xcdbe2c45, 0x3fd5af46,
0x7198540d, 0x83f3d70e, 0x90a324fa, 0x62c8a7f9,
0xb602c312, 0x44694011, 0x5739b3e5, 0xa55230e6,
0xfb410cc2, 0x092a8fc1, 0x1a7a7c35, 0xe811ff36,
0x3cdb9bdd, 0xceb018de, 0xdde0eb2a, 0x2f8b6829,
0x82f63b78, 0x709db87b, 0x63cd4b8f, 0x91a6c88c,
0x456cac67, 0xb7072f64, 0xa457dc90, 0x563c5f93,
0x082f63b7, 0xfa44e0b4, 0xe9141340, 0x1b7f9043,
0xcfb5f4a8, 0x3dde77ab, 0x2e8e845f, 0xdce5075c,
0x92a8fc17, 0x60c37f14, 0x73938ce0, 0x81f80fe3,
0x55326b08, 0xa759e80b, 0xb4091bff, 0x466298fc,
0x1871a4d8, 0xea1a27db, 0xf94ad42f, 0x0b21572c,
0xdfeb33c7, 0x2d80b0c4, 0x3ed04330, 0xccbbc033,
0xa24bb5a6, 0x502036a5, 0x4370c551, 0xb11b4652,
0x65d122b9, 0x97baa1ba, 0x84ea524e, 0x7681d14d,
0x2892ed69, 0xdaf96e6a, 0xc9a99d9e, 0x3bc21e9d,
0xef087a76, 0x1d63f975, 0x0e330a81, 0xfc588982,
0xb21572c9, 0x407ef1ca, 0x532e023e, 0xa145813d,
0x758fe5d6, 0x87e466d5, 0x94b49521, 0x66df1622,
0x38cc2a06, 0xcaa7a905, 0xd9f75af1, 0x2b9cd9f2,
0xff56bd19, 0x0d3d3e1a, 0x1e6dcdee, 0xec064eed,
0xc38d26c4, 0x31e6a5c7, 0x22b65633, 0xd0ddd530,
0x0417b1db, 0xf67c32d8, 0xe52cc12c, 0x1747422f,
0x49547e0b, 0xbb3ffd08, 0xa86f0efc, 0x5a048dff,
0x8ecee914, 0x7ca56a17, 0x6ff599e3, 0x9d9e1ae0,
0xd3d3e1ab, 0x21b862a8, 0x32e8915c, 0xc083125f,
0x144976b4, 0xe622f5b7, 0xf5720643, 0x07198540,
0x590ab964, 0xab613a67, 0xb831c993, 0x4a5a4a90,
0x9e902e7b, 0x6cfbad78, 0x7fab5e8c, 0x8dc0dd8f,
0xe330a81a, 0x115b2b19, 0x020bd8ed, 0xf0605bee,
0x24aa3f05, 0xd6c1bc06, 0xc5914ff2, 0x37faccf1,
0x69e9f0d5, 0x9b8273d6, 0x88d28022, 0x7ab90321,
0xae7367ca, 0x5c18e4c9, 0x4f48173d, 0xbd23943e,
0xf36e6f75, 0x0105ec76, 0x12551f82, 0xe03e9c81,
0x34f4f86a, 0xc69f7b69, 0xd5cf889d, 0x27a40b9e,
0x79b737ba, 0x8bdcb4b9, 0x988c474d, 0x6ae7c44e,
0xbe2da0a5, 0x4c4623a6, 0x5f16d052, 0xad7d5351,};
#include "crc32_wrapper.ic"
#endif

View file

@ -0,0 +1,14 @@
#ifdef __powerpc__
#define CONSTANTS .crc32_constants
#define SHORT_CONSTANTS .crc32_short_constants
#define BARRETT_CONSTANTS .crc32_barrett_constants
#include "crc32ieee_constants.h"
#define __F __crc32ieee_vpmsum
#include "crc32.iS"
#endif

View file

@ -0,0 +1,835 @@
#ifndef CRC32_CONSTANTS_H
#define CRC32_CONSTANTS_H
#ifdef __powerpc__
#define MAX_SIZE 32768
CONSTANTS:
/* Reduce 262144 kbits to 1024 bits */
/* x^261120 mod p(x)` << 1, x^261184 mod p(x)` << 1 */
.octa 0x00000001651797d20000000099ea94a8
/* x^260096 mod p(x)` << 1, x^260160 mod p(x)` << 1 */
.octa 0x0000000021e0d56c00000000945a8420
/* x^259072 mod p(x)` << 1, x^259136 mod p(x)` << 1 */
.octa 0x000000000f95ecaa0000000030762706
/* x^258048 mod p(x)` << 1, x^258112 mod p(x)` << 1 */
.octa 0x00000001ebd224ac00000001a52fc582
/* x^257024 mod p(x)` << 1, x^257088 mod p(x)` << 1 */
.octa 0x000000000ccb97ca00000001a4a7167a
/* x^256000 mod p(x)` << 1, x^256064 mod p(x)` << 1 */
.octa 0x00000001006ec8a8000000000c18249a
/* x^254976 mod p(x)` << 1, x^255040 mod p(x)` << 1 */
.octa 0x000000014f58f19600000000a924ae7c
/* x^253952 mod p(x)` << 1, x^254016 mod p(x)` << 1 */
.octa 0x00000001a7192ca600000001e12ccc12
/* x^252928 mod p(x)` << 1, x^252992 mod p(x)` << 1 */
.octa 0x000000019a64bab200000000a0b9d4ac
/* x^251904 mod p(x)` << 1, x^251968 mod p(x)` << 1 */
.octa 0x0000000014f4ed2e0000000095e8ddfe
/* x^250880 mod p(x)` << 1, x^250944 mod p(x)` << 1 */
.octa 0x000000011092b6a200000000233fddc4
/* x^249856 mod p(x)` << 1, x^249920 mod p(x)` << 1 */
.octa 0x00000000c8a1629c00000001b4529b62
/* x^248832 mod p(x)` << 1, x^248896 mod p(x)` << 1 */
.octa 0x000000017bf32e8e00000001a7fa0e64
/* x^247808 mod p(x)` << 1, x^247872 mod p(x)` << 1 */
.octa 0x00000001f8cc658200000001b5334592
/* x^246784 mod p(x)` << 1, x^246848 mod p(x)` << 1 */
.octa 0x000000008631ddf0000000011f8ee1b4
/* x^245760 mod p(x)` << 1, x^245824 mod p(x)` << 1 */
.octa 0x000000007e5a76d0000000006252e632
/* x^244736 mod p(x)` << 1, x^244800 mod p(x)` << 1 */
.octa 0x000000002b09b31c00000000ab973e84
/* x^243712 mod p(x)` << 1, x^243776 mod p(x)` << 1 */
.octa 0x00000001b2df1f84000000007734f5ec
/* x^242688 mod p(x)` << 1, x^242752 mod p(x)` << 1 */
.octa 0x00000001d6f56afc000000007c547798
/* x^241664 mod p(x)` << 1, x^241728 mod p(x)` << 1 */
.octa 0x00000001b9b5e70c000000007ec40210
/* x^240640 mod p(x)` << 1, x^240704 mod p(x)` << 1 */
.octa 0x0000000034b626d200000001ab1695a8
/* x^239616 mod p(x)` << 1, x^239680 mod p(x)` << 1 */
.octa 0x000000014c53479a0000000090494bba
/* x^238592 mod p(x)` << 1, x^238656 mod p(x)` << 1 */
.octa 0x00000001a6d179a400000001123fb816
/* x^237568 mod p(x)` << 1, x^237632 mod p(x)` << 1 */
.octa 0x000000015abd16b400000001e188c74c
/* x^236544 mod p(x)` << 1, x^236608 mod p(x)` << 1 */
.octa 0x00000000018f985200000001c2d3451c
/* x^235520 mod p(x)` << 1, x^235584 mod p(x)` << 1 */
.octa 0x000000001fb3084a00000000f55cf1ca
/* x^234496 mod p(x)` << 1, x^234560 mod p(x)` << 1 */
.octa 0x00000000c53dfb0400000001a0531540
/* x^233472 mod p(x)` << 1, x^233536 mod p(x)` << 1 */
.octa 0x00000000e10c9ad60000000132cd7ebc
/* x^232448 mod p(x)` << 1, x^232512 mod p(x)` << 1 */
.octa 0x0000000025aa994a0000000073ab7f36
/* x^231424 mod p(x)` << 1, x^231488 mod p(x)` << 1 */
.octa 0x00000000fa3a74c40000000041aed1c2
/* x^230400 mod p(x)` << 1, x^230464 mod p(x)` << 1 */
.octa 0x0000000033eb3f400000000136c53800
/* x^229376 mod p(x)` << 1, x^229440 mod p(x)` << 1 */
.octa 0x000000017193f2960000000126835a30
/* x^228352 mod p(x)` << 1, x^228416 mod p(x)` << 1 */
.octa 0x0000000043f6c86a000000006241b502
/* x^227328 mod p(x)` << 1, x^227392 mod p(x)` << 1 */
.octa 0x000000016b513ec600000000d5196ad4
/* x^226304 mod p(x)` << 1, x^226368 mod p(x)` << 1 */
.octa 0x00000000c8f25b4e000000009cfa769a
/* x^225280 mod p(x)` << 1, x^225344 mod p(x)` << 1 */
.octa 0x00000001a45048ec00000000920e5df4
/* x^224256 mod p(x)` << 1, x^224320 mod p(x)` << 1 */
.octa 0x000000000c4410040000000169dc310e
/* x^223232 mod p(x)` << 1, x^223296 mod p(x)` << 1 */
.octa 0x000000000e17cad60000000009fc331c
/* x^222208 mod p(x)` << 1, x^222272 mod p(x)` << 1 */
.octa 0x00000001253ae964000000010d94a81e
/* x^221184 mod p(x)` << 1, x^221248 mod p(x)` << 1 */
.octa 0x00000001d7c88ebc0000000027a20ab2
/* x^220160 mod p(x)` << 1, x^220224 mod p(x)` << 1 */
.octa 0x00000001e7ca913a0000000114f87504
/* x^219136 mod p(x)` << 1, x^219200 mod p(x)` << 1 */
.octa 0x0000000033ed078a000000004b076d96
/* x^218112 mod p(x)` << 1, x^218176 mod p(x)` << 1 */
.octa 0x00000000e1839c7800000000da4d1e74
/* x^217088 mod p(x)` << 1, x^217152 mod p(x)` << 1 */
.octa 0x00000001322b267e000000001b81f672
/* x^216064 mod p(x)` << 1, x^216128 mod p(x)` << 1 */
.octa 0x00000000638231b6000000009367c988
/* x^215040 mod p(x)` << 1, x^215104 mod p(x)` << 1 */
.octa 0x00000001ee7f16f400000001717214ca
/* x^214016 mod p(x)` << 1, x^214080 mod p(x)` << 1 */
.octa 0x0000000117d9924a000000009f47d820
/* x^212992 mod p(x)` << 1, x^213056 mod p(x)` << 1 */
.octa 0x00000000e1a9e0c4000000010d9a47d2
/* x^211968 mod p(x)` << 1, x^212032 mod p(x)` << 1 */
.octa 0x00000001403731dc00000000a696c58c
/* x^210944 mod p(x)` << 1, x^211008 mod p(x)` << 1 */
.octa 0x00000001a5ea9682000000002aa28ec6
/* x^209920 mod p(x)` << 1, x^209984 mod p(x)` << 1 */
.octa 0x0000000101c5c57800000001fe18fd9a
/* x^208896 mod p(x)` << 1, x^208960 mod p(x)` << 1 */
.octa 0x00000000dddf6494000000019d4fc1ae
/* x^207872 mod p(x)` << 1, x^207936 mod p(x)` << 1 */
.octa 0x00000000f1c3db2800000001ba0e3dea
/* x^206848 mod p(x)` << 1, x^206912 mod p(x)` << 1 */
.octa 0x000000013112fb9c0000000074b59a5e
/* x^205824 mod p(x)` << 1, x^205888 mod p(x)` << 1 */
.octa 0x00000000b680b90600000000f2b5ea98
/* x^204800 mod p(x)` << 1, x^204864 mod p(x)` << 1 */
.octa 0x000000001a2829320000000187132676
/* x^203776 mod p(x)` << 1, x^203840 mod p(x)` << 1 */
.octa 0x0000000089406e7e000000010a8c6ad4
/* x^202752 mod p(x)` << 1, x^202816 mod p(x)` << 1 */
.octa 0x00000001def6be8c00000001e21dfe70
/* x^201728 mod p(x)` << 1, x^201792 mod p(x)` << 1 */
.octa 0x000000007525872800000001da0050e4
/* x^200704 mod p(x)` << 1, x^200768 mod p(x)` << 1 */
.octa 0x000000019536090a00000000772172ae
/* x^199680 mod p(x)` << 1, x^199744 mod p(x)` << 1 */
.octa 0x00000000f2455bfc00000000e47724aa
/* x^198656 mod p(x)` << 1, x^198720 mod p(x)` << 1 */
.octa 0x000000018c40baf4000000003cd63ac4
/* x^197632 mod p(x)` << 1, x^197696 mod p(x)` << 1 */
.octa 0x000000004cd390d400000001bf47d352
/* x^196608 mod p(x)` << 1, x^196672 mod p(x)` << 1 */
.octa 0x00000001e4ece95a000000018dc1d708
/* x^195584 mod p(x)` << 1, x^195648 mod p(x)` << 1 */
.octa 0x000000001a3ee918000000002d4620a4
/* x^194560 mod p(x)` << 1, x^194624 mod p(x)` << 1 */
.octa 0x000000007c652fb80000000058fd1740
/* x^193536 mod p(x)` << 1, x^193600 mod p(x)` << 1 */
.octa 0x000000011c67842c00000000dadd9bfc
/* x^192512 mod p(x)` << 1, x^192576 mod p(x)` << 1 */
.octa 0x00000000254f759c00000001ea2140be
/* x^191488 mod p(x)` << 1, x^191552 mod p(x)` << 1 */
.octa 0x000000007ece94ca000000009de128ba
/* x^190464 mod p(x)` << 1, x^190528 mod p(x)` << 1 */
.octa 0x0000000038f258c2000000013ac3aa8e
/* x^189440 mod p(x)` << 1, x^189504 mod p(x)` << 1 */
.octa 0x00000001cdf17b000000000099980562
/* x^188416 mod p(x)` << 1, x^188480 mod p(x)` << 1 */
.octa 0x000000011f882c1600000001c1579c86
/* x^187392 mod p(x)` << 1, x^187456 mod p(x)` << 1 */
.octa 0x0000000100093fc80000000068dbbf94
/* x^186368 mod p(x)` << 1, x^186432 mod p(x)` << 1 */
.octa 0x00000001cd684f16000000004509fb04
/* x^185344 mod p(x)` << 1, x^185408 mod p(x)` << 1 */
.octa 0x000000004bc6a70a00000001202f6398
/* x^184320 mod p(x)` << 1, x^184384 mod p(x)` << 1 */
.octa 0x000000004fc7e8e4000000013aea243e
/* x^183296 mod p(x)` << 1, x^183360 mod p(x)` << 1 */
.octa 0x0000000130103f1c00000001b4052ae6
/* x^182272 mod p(x)` << 1, x^182336 mod p(x)` << 1 */
.octa 0x0000000111b0024c00000001cd2a0ae8
/* x^181248 mod p(x)` << 1, x^181312 mod p(x)` << 1 */
.octa 0x000000010b3079da00000001fe4aa8b4
/* x^180224 mod p(x)` << 1, x^180288 mod p(x)` << 1 */
.octa 0x000000010192bcc200000001d1559a42
/* x^179200 mod p(x)` << 1, x^179264 mod p(x)` << 1 */
.octa 0x0000000074838d5000000001f3e05ecc
/* x^178176 mod p(x)` << 1, x^178240 mod p(x)` << 1 */
.octa 0x000000001b20f5200000000104ddd2cc
/* x^177152 mod p(x)` << 1, x^177216 mod p(x)` << 1 */
.octa 0x0000000050c3590a000000015393153c
/* x^176128 mod p(x)` << 1, x^176192 mod p(x)` << 1 */
.octa 0x00000000b41cac8e0000000057e942c6
/* x^175104 mod p(x)` << 1, x^175168 mod p(x)` << 1 */
.octa 0x000000000c72cc78000000012c633850
/* x^174080 mod p(x)` << 1, x^174144 mod p(x)` << 1 */
.octa 0x0000000030cdb03200000000ebcaae4c
/* x^173056 mod p(x)` << 1, x^173120 mod p(x)` << 1 */
.octa 0x000000013e09fc32000000013ee532a6
/* x^172032 mod p(x)` << 1, x^172096 mod p(x)` << 1 */
.octa 0x000000001ed624d200000001bf0cbc7e
/* x^171008 mod p(x)` << 1, x^171072 mod p(x)` << 1 */
.octa 0x00000000781aee1a00000000d50b7a5a
/* x^169984 mod p(x)` << 1, x^170048 mod p(x)` << 1 */
.octa 0x00000001c4d8348c0000000002fca6e8
/* x^168960 mod p(x)` << 1, x^169024 mod p(x)` << 1 */
.octa 0x0000000057a40336000000007af40044
/* x^167936 mod p(x)` << 1, x^168000 mod p(x)` << 1 */
.octa 0x00000000855449400000000016178744
/* x^166912 mod p(x)` << 1, x^166976 mod p(x)` << 1 */
.octa 0x000000019cd21e80000000014c177458
/* x^165888 mod p(x)` << 1, x^165952 mod p(x)` << 1 */
.octa 0x000000013eb95bc0000000011b6ddf04
/* x^164864 mod p(x)` << 1, x^164928 mod p(x)` << 1 */
.octa 0x00000001dfc9fdfc00000001f3e29ccc
/* x^163840 mod p(x)` << 1, x^163904 mod p(x)` << 1 */
.octa 0x00000000cd028bc20000000135ae7562
/* x^162816 mod p(x)` << 1, x^162880 mod p(x)` << 1 */
.octa 0x0000000090db8c440000000190ef812c
/* x^161792 mod p(x)` << 1, x^161856 mod p(x)` << 1 */
.octa 0x000000010010a4ce0000000067a2c786
/* x^160768 mod p(x)` << 1, x^160832 mod p(x)` << 1 */
.octa 0x00000001c8f4c72c0000000048b9496c
/* x^159744 mod p(x)` << 1, x^159808 mod p(x)` << 1 */
.octa 0x000000001c26170c000000015a422de6
/* x^158720 mod p(x)` << 1, x^158784 mod p(x)` << 1 */
.octa 0x00000000e3fccf6800000001ef0e3640
/* x^157696 mod p(x)` << 1, x^157760 mod p(x)` << 1 */
.octa 0x00000000d513ed2400000001006d2d26
/* x^156672 mod p(x)` << 1, x^156736 mod p(x)` << 1 */
.octa 0x00000000141beada00000001170d56d6
/* x^155648 mod p(x)` << 1, x^155712 mod p(x)` << 1 */
.octa 0x000000011071aea000000000a5fb613c
/* x^154624 mod p(x)` << 1, x^154688 mod p(x)` << 1 */
.octa 0x000000012e19080a0000000040bbf7fc
/* x^153600 mod p(x)` << 1, x^153664 mod p(x)` << 1 */
.octa 0x0000000100ecf826000000016ac3a5b2
/* x^152576 mod p(x)` << 1, x^152640 mod p(x)` << 1 */
.octa 0x0000000069b0941200000000abf16230
/* x^151552 mod p(x)` << 1, x^151616 mod p(x)` << 1 */
.octa 0x0000000122297bac00000001ebe23fac
/* x^150528 mod p(x)` << 1, x^150592 mod p(x)` << 1 */
.octa 0x00000000e9e4b068000000008b6a0894
/* x^149504 mod p(x)` << 1, x^149568 mod p(x)` << 1 */
.octa 0x000000004b38651a00000001288ea478
/* x^148480 mod p(x)` << 1, x^148544 mod p(x)` << 1 */
.octa 0x00000001468360e2000000016619c442
/* x^147456 mod p(x)` << 1, x^147520 mod p(x)` << 1 */
.octa 0x00000000121c24080000000086230038
/* x^146432 mod p(x)` << 1, x^146496 mod p(x)` << 1 */
.octa 0x00000000da7e7d08000000017746a756
/* x^145408 mod p(x)` << 1, x^145472 mod p(x)` << 1 */
.octa 0x00000001058d76520000000191b8f8f8
/* x^144384 mod p(x)` << 1, x^144448 mod p(x)` << 1 */
.octa 0x000000014a098a90000000008e167708
/* x^143360 mod p(x)` << 1, x^143424 mod p(x)` << 1 */
.octa 0x0000000020dbe72e0000000148b22d54
/* x^142336 mod p(x)` << 1, x^142400 mod p(x)` << 1 */
.octa 0x000000011e7323e80000000044ba2c3c
/* x^141312 mod p(x)` << 1, x^141376 mod p(x)` << 1 */
.octa 0x00000000d5d4bf9400000000b54d2b52
/* x^140288 mod p(x)` << 1, x^140352 mod p(x)` << 1 */
.octa 0x0000000199d8746c0000000005a4fd8a
/* x^139264 mod p(x)` << 1, x^139328 mod p(x)` << 1 */
.octa 0x00000000ce9ca8a00000000139f9fc46
/* x^138240 mod p(x)` << 1, x^138304 mod p(x)` << 1 */
.octa 0x00000000136edece000000015a1fa824
/* x^137216 mod p(x)` << 1, x^137280 mod p(x)` << 1 */
.octa 0x000000019b92a068000000000a61ae4c
/* x^136192 mod p(x)` << 1, x^136256 mod p(x)` << 1 */
.octa 0x0000000071d622060000000145e9113e
/* x^135168 mod p(x)` << 1, x^135232 mod p(x)` << 1 */
.octa 0x00000000dfc50158000000006a348448
/* x^134144 mod p(x)` << 1, x^134208 mod p(x)` << 1 */
.octa 0x00000001517626bc000000004d80a08c
/* x^133120 mod p(x)` << 1, x^133184 mod p(x)` << 1 */
.octa 0x0000000148d1e4fa000000014b6837a0
/* x^132096 mod p(x)` << 1, x^132160 mod p(x)` << 1 */
.octa 0x0000000094d8266e000000016896a7fc
/* x^131072 mod p(x)` << 1, x^131136 mod p(x)` << 1 */
.octa 0x00000000606c5e34000000014f187140
/* x^130048 mod p(x)` << 1, x^130112 mod p(x)` << 1 */
.octa 0x000000019766beaa000000019581b9da
/* x^129024 mod p(x)` << 1, x^129088 mod p(x)` << 1 */
.octa 0x00000001d80c506c00000001091bc984
/* x^128000 mod p(x)` << 1, x^128064 mod p(x)` << 1 */
.octa 0x000000001e73837c000000001067223c
/* x^126976 mod p(x)` << 1, x^127040 mod p(x)` << 1 */
.octa 0x0000000064d587de00000001ab16ea02
/* x^125952 mod p(x)` << 1, x^126016 mod p(x)` << 1 */
.octa 0x00000000f4a507b0000000013c4598a8
/* x^124928 mod p(x)` << 1, x^124992 mod p(x)` << 1 */
.octa 0x0000000040e342fc00000000b3735430
/* x^123904 mod p(x)` << 1, x^123968 mod p(x)` << 1 */
.octa 0x00000001d5ad9c3a00000001bb3fc0c0
/* x^122880 mod p(x)` << 1, x^122944 mod p(x)` << 1 */
.octa 0x0000000094a691a400000001570ae19c
/* x^121856 mod p(x)` << 1, x^121920 mod p(x)` << 1 */
.octa 0x00000001271ecdfa00000001ea910712
/* x^120832 mod p(x)` << 1, x^120896 mod p(x)` << 1 */
.octa 0x000000009e54475a0000000167127128
/* x^119808 mod p(x)` << 1, x^119872 mod p(x)` << 1 */
.octa 0x00000000c9c099ee0000000019e790a2
/* x^118784 mod p(x)` << 1, x^118848 mod p(x)` << 1 */
.octa 0x000000009a2f736c000000003788f710
/* x^117760 mod p(x)` << 1, x^117824 mod p(x)` << 1 */
.octa 0x00000000bb9f499600000001682a160e
/* x^116736 mod p(x)` << 1, x^116800 mod p(x)` << 1 */
.octa 0x00000001db688050000000007f0ebd2e
/* x^115712 mod p(x)` << 1, x^115776 mod p(x)` << 1 */
.octa 0x00000000e9b10af4000000002b032080
/* x^114688 mod p(x)` << 1, x^114752 mod p(x)` << 1 */
.octa 0x000000012d4545e400000000cfd1664a
/* x^113664 mod p(x)` << 1, x^113728 mod p(x)` << 1 */
.octa 0x000000000361139c00000000aa1181c2
/* x^112640 mod p(x)` << 1, x^112704 mod p(x)` << 1 */
.octa 0x00000001a5a1a3a800000000ddd08002
/* x^111616 mod p(x)` << 1, x^111680 mod p(x)` << 1 */
.octa 0x000000006844e0b000000000e8dd0446
/* x^110592 mod p(x)` << 1, x^110656 mod p(x)` << 1 */
.octa 0x00000000c3762f2800000001bbd94a00
/* x^109568 mod p(x)` << 1, x^109632 mod p(x)` << 1 */
.octa 0x00000001d26287a200000000ab6cd180
/* x^108544 mod p(x)` << 1, x^108608 mod p(x)` << 1 */
.octa 0x00000001f6f0bba80000000031803ce2
/* x^107520 mod p(x)` << 1, x^107584 mod p(x)` << 1 */
.octa 0x000000002ffabd620000000024f40b0c
/* x^106496 mod p(x)` << 1, x^106560 mod p(x)` << 1 */
.octa 0x00000000fb4516b800000001ba1d9834
/* x^105472 mod p(x)` << 1, x^105536 mod p(x)` << 1 */
.octa 0x000000018cfa961c0000000104de61aa
/* x^104448 mod p(x)` << 1, x^104512 mod p(x)` << 1 */
.octa 0x000000019e588d520000000113e40d46
/* x^103424 mod p(x)` << 1, x^103488 mod p(x)` << 1 */
.octa 0x00000001180f0bbc00000001415598a0
/* x^102400 mod p(x)` << 1, x^102464 mod p(x)` << 1 */
.octa 0x00000000e1d9177a00000000bf6c8c90
/* x^101376 mod p(x)` << 1, x^101440 mod p(x)` << 1 */
.octa 0x0000000105abc27c00000001788b0504
/* x^100352 mod p(x)` << 1, x^100416 mod p(x)` << 1 */
.octa 0x00000000972e4a580000000038385d02
/* x^99328 mod p(x)` << 1, x^99392 mod p(x)` << 1 */
.octa 0x0000000183499a5e00000001b6c83844
/* x^98304 mod p(x)` << 1, x^98368 mod p(x)` << 1 */
.octa 0x00000001c96a8cca0000000051061a8a
/* x^97280 mod p(x)` << 1, x^97344 mod p(x)` << 1 */
.octa 0x00000001a1a5b60c000000017351388a
/* x^96256 mod p(x)` << 1, x^96320 mod p(x)` << 1 */
.octa 0x00000000e4b6ac9c0000000132928f92
/* x^95232 mod p(x)` << 1, x^95296 mod p(x)` << 1 */
.octa 0x00000001807e7f5a00000000e6b4f48a
/* x^94208 mod p(x)` << 1, x^94272 mod p(x)` << 1 */
.octa 0x000000017a7e3bc80000000039d15e90
/* x^93184 mod p(x)` << 1, x^93248 mod p(x)` << 1 */
.octa 0x00000000d73975da00000000312d6074
/* x^92160 mod p(x)` << 1, x^92224 mod p(x)` << 1 */
.octa 0x000000017375d038000000017bbb2cc4
/* x^91136 mod p(x)` << 1, x^91200 mod p(x)` << 1 */
.octa 0x00000000193680bc000000016ded3e18
/* x^90112 mod p(x)` << 1, x^90176 mod p(x)` << 1 */
.octa 0x00000000999b06f600000000f1638b16
/* x^89088 mod p(x)` << 1, x^89152 mod p(x)` << 1 */
.octa 0x00000001f685d2b800000001d38b9ecc
/* x^88064 mod p(x)` << 1, x^88128 mod p(x)` << 1 */
.octa 0x00000001f4ecbed2000000018b8d09dc
/* x^87040 mod p(x)` << 1, x^87104 mod p(x)` << 1 */
.octa 0x00000000ba16f1a000000000e7bc27d2
/* x^86016 mod p(x)` << 1, x^86080 mod p(x)` << 1 */
.octa 0x0000000115aceac400000000275e1e96
/* x^84992 mod p(x)` << 1, x^85056 mod p(x)` << 1 */
.octa 0x00000001aeff629200000000e2e3031e
/* x^83968 mod p(x)` << 1, x^84032 mod p(x)` << 1 */
.octa 0x000000009640124c00000001041c84d8
/* x^82944 mod p(x)` << 1, x^83008 mod p(x)` << 1 */
.octa 0x0000000114f41f0200000000706ce672
/* x^81920 mod p(x)` << 1, x^81984 mod p(x)` << 1 */
.octa 0x000000009c5f3586000000015d5070da
/* x^80896 mod p(x)` << 1, x^80960 mod p(x)` << 1 */
.octa 0x00000001878275fa0000000038f9493a
/* x^79872 mod p(x)` << 1, x^79936 mod p(x)` << 1 */
.octa 0x00000000ddc42ce800000000a3348a76
/* x^78848 mod p(x)` << 1, x^78912 mod p(x)` << 1 */
.octa 0x0000000181d2c73a00000001ad0aab92
/* x^77824 mod p(x)` << 1, x^77888 mod p(x)` << 1 */
.octa 0x0000000141c9320a000000019e85f712
/* x^76800 mod p(x)` << 1, x^76864 mod p(x)` << 1 */
.octa 0x000000015235719a000000005a871e76
/* x^75776 mod p(x)` << 1, x^75840 mod p(x)` << 1 */
.octa 0x00000000be27d804000000017249c662
/* x^74752 mod p(x)` << 1, x^74816 mod p(x)` << 1 */
.octa 0x000000006242d45a000000003a084712
/* x^73728 mod p(x)` << 1, x^73792 mod p(x)` << 1 */
.octa 0x000000009a53638e00000000ed438478
/* x^72704 mod p(x)` << 1, x^72768 mod p(x)` << 1 */
.octa 0x00000001001ecfb600000000abac34cc
/* x^71680 mod p(x)` << 1, x^71744 mod p(x)` << 1 */
.octa 0x000000016d7c2d64000000005f35ef3e
/* x^70656 mod p(x)` << 1, x^70720 mod p(x)` << 1 */
.octa 0x00000001d0ce46c00000000047d6608c
/* x^69632 mod p(x)` << 1, x^69696 mod p(x)` << 1 */
.octa 0x0000000124c907b4000000002d01470e
/* x^68608 mod p(x)` << 1, x^68672 mod p(x)` << 1 */
.octa 0x0000000018a555ca0000000158bbc7b0
/* x^67584 mod p(x)` << 1, x^67648 mod p(x)` << 1 */
.octa 0x000000006b0980bc00000000c0a23e8e
/* x^66560 mod p(x)` << 1, x^66624 mod p(x)` << 1 */
.octa 0x000000008bbba96400000001ebd85c88
/* x^65536 mod p(x)` << 1, x^65600 mod p(x)` << 1 */
.octa 0x00000001070a5a1e000000019ee20bb2
/* x^64512 mod p(x)` << 1, x^64576 mod p(x)` << 1 */
.octa 0x000000002204322a00000001acabf2d6
/* x^63488 mod p(x)` << 1, x^63552 mod p(x)` << 1 */
.octa 0x00000000a27524d000000001b7963d56
/* x^62464 mod p(x)` << 1, x^62528 mod p(x)` << 1 */
.octa 0x0000000020b1e4ba000000017bffa1fe
/* x^61440 mod p(x)` << 1, x^61504 mod p(x)` << 1 */
.octa 0x0000000032cc27fc000000001f15333e
/* x^60416 mod p(x)` << 1, x^60480 mod p(x)` << 1 */
.octa 0x0000000044dd22b8000000018593129e
/* x^59392 mod p(x)` << 1, x^59456 mod p(x)` << 1 */
.octa 0x00000000dffc9e0a000000019cb32602
/* x^58368 mod p(x)` << 1, x^58432 mod p(x)` << 1 */
.octa 0x00000001b7a0ed140000000142b05cc8
/* x^57344 mod p(x)` << 1, x^57408 mod p(x)` << 1 */
.octa 0x00000000c784248800000001be49e7a4
/* x^56320 mod p(x)` << 1, x^56384 mod p(x)` << 1 */
.octa 0x00000001c02a4fee0000000108f69d6c
/* x^55296 mod p(x)` << 1, x^55360 mod p(x)` << 1 */
.octa 0x000000003c273778000000006c0971f0
/* x^54272 mod p(x)` << 1, x^54336 mod p(x)` << 1 */
.octa 0x00000001d63f8894000000005b16467a
/* x^53248 mod p(x)` << 1, x^53312 mod p(x)` << 1 */
.octa 0x000000006be557d600000001551a628e
/* x^52224 mod p(x)` << 1, x^52288 mod p(x)` << 1 */
.octa 0x000000006a7806ea000000019e42ea92
/* x^51200 mod p(x)` << 1, x^51264 mod p(x)` << 1 */
.octa 0x000000016155aa0c000000012fa83ff2
/* x^50176 mod p(x)` << 1, x^50240 mod p(x)` << 1 */
.octa 0x00000000908650ac000000011ca9cde0
/* x^49152 mod p(x)` << 1, x^49216 mod p(x)` << 1 */
.octa 0x00000000aa5a808400000000c8e5cd74
/* x^48128 mod p(x)` << 1, x^48192 mod p(x)` << 1 */
.octa 0x0000000191bb500a0000000096c27f0c
/* x^47104 mod p(x)` << 1, x^47168 mod p(x)` << 1 */
.octa 0x0000000064e9bed0000000002baed926
/* x^46080 mod p(x)` << 1, x^46144 mod p(x)` << 1 */
.octa 0x000000009444f302000000017c8de8d2
/* x^45056 mod p(x)` << 1, x^45120 mod p(x)` << 1 */
.octa 0x000000019db07d3c00000000d43d6068
/* x^44032 mod p(x)` << 1, x^44096 mod p(x)` << 1 */
.octa 0x00000001359e3e6e00000000cb2c4b26
/* x^43008 mod p(x)` << 1, x^43072 mod p(x)` << 1 */
.octa 0x00000001e4f10dd20000000145b8da26
/* x^41984 mod p(x)` << 1, x^42048 mod p(x)` << 1 */
.octa 0x0000000124f5735e000000018fff4b08
/* x^40960 mod p(x)` << 1, x^41024 mod p(x)` << 1 */
.octa 0x0000000124760a4c0000000150b58ed0
/* x^39936 mod p(x)` << 1, x^40000 mod p(x)` << 1 */
.octa 0x000000000f1fc18600000001549f39bc
/* x^38912 mod p(x)` << 1, x^38976 mod p(x)` << 1 */
.octa 0x00000000150e4cc400000000ef4d2f42
/* x^37888 mod p(x)` << 1, x^37952 mod p(x)` << 1 */
.octa 0x000000002a6204e800000001b1468572
/* x^36864 mod p(x)` << 1, x^36928 mod p(x)` << 1 */
.octa 0x00000000beb1d432000000013d7403b2
/* x^35840 mod p(x)` << 1, x^35904 mod p(x)` << 1 */
.octa 0x0000000135f3f1f000000001a4681842
/* x^34816 mod p(x)` << 1, x^34880 mod p(x)` << 1 */
.octa 0x0000000074fe22320000000167714492
/* x^33792 mod p(x)` << 1, x^33856 mod p(x)` << 1 */
.octa 0x000000001ac6e2ba00000001e599099a
/* x^32768 mod p(x)` << 1, x^32832 mod p(x)` << 1 */
.octa 0x0000000013fca91e00000000fe128194
/* x^31744 mod p(x)` << 1, x^31808 mod p(x)` << 1 */
.octa 0x0000000183f4931e0000000077e8b990
/* x^30720 mod p(x)` << 1, x^30784 mod p(x)` << 1 */
.octa 0x00000000b6d9b4e400000001a267f63a
/* x^29696 mod p(x)` << 1, x^29760 mod p(x)` << 1 */
.octa 0x00000000b518865600000001945c245a
/* x^28672 mod p(x)` << 1, x^28736 mod p(x)` << 1 */
.octa 0x0000000027a81a840000000149002e76
/* x^27648 mod p(x)` << 1, x^27712 mod p(x)` << 1 */
.octa 0x000000012569925800000001bb8310a4
/* x^26624 mod p(x)` << 1, x^26688 mod p(x)` << 1 */
.octa 0x00000001b23de796000000019ec60bcc
/* x^25600 mod p(x)` << 1, x^25664 mod p(x)` << 1 */
.octa 0x00000000fe4365dc000000012d8590ae
/* x^24576 mod p(x)` << 1, x^24640 mod p(x)` << 1 */
.octa 0x00000000c68f497a0000000065b00684
/* x^23552 mod p(x)` << 1, x^23616 mod p(x)` << 1 */
.octa 0x00000000fbf521ee000000015e5aeadc
/* x^22528 mod p(x)` << 1, x^22592 mod p(x)` << 1 */
.octa 0x000000015eac337800000000b77ff2b0
/* x^21504 mod p(x)` << 1, x^21568 mod p(x)` << 1 */
.octa 0x0000000134914b900000000188da2ff6
/* x^20480 mod p(x)` << 1, x^20544 mod p(x)` << 1 */
.octa 0x0000000016335cfe0000000063da929a
/* x^19456 mod p(x)` << 1, x^19520 mod p(x)` << 1 */
.octa 0x000000010372d10c00000001389caa80
/* x^18432 mod p(x)` << 1, x^18496 mod p(x)` << 1 */
.octa 0x000000015097b908000000013db599d2
/* x^17408 mod p(x)` << 1, x^17472 mod p(x)` << 1 */
.octa 0x00000001227a75720000000122505a86
/* x^16384 mod p(x)` << 1, x^16448 mod p(x)` << 1 */
.octa 0x000000009a8f75c0000000016bd72746
/* x^15360 mod p(x)` << 1, x^15424 mod p(x)` << 1 */
.octa 0x00000000682c77a200000001c3faf1d4
/* x^14336 mod p(x)` << 1, x^14400 mod p(x)` << 1 */
.octa 0x00000000231f091c00000001111c826c
/* x^13312 mod p(x)` << 1, x^13376 mod p(x)` << 1 */
.octa 0x000000007d4439f200000000153e9fb2
/* x^12288 mod p(x)` << 1, x^12352 mod p(x)` << 1 */
.octa 0x000000017e221efc000000002b1f7b60
/* x^11264 mod p(x)` << 1, x^11328 mod p(x)` << 1 */
.octa 0x0000000167457c3800000000b1dba570
/* x^10240 mod p(x)` << 1, x^10304 mod p(x)` << 1 */
.octa 0x00000000bdf081c400000001f6397b76
/* x^9216 mod p(x)` << 1, x^9280 mod p(x)` << 1 */
.octa 0x000000016286d6b00000000156335214
/* x^8192 mod p(x)` << 1, x^8256 mod p(x)` << 1 */
.octa 0x00000000c84f001c00000001d70e3986
/* x^7168 mod p(x)` << 1, x^7232 mod p(x)` << 1 */
.octa 0x0000000064efe7c0000000003701a774
/* x^6144 mod p(x)` << 1, x^6208 mod p(x)` << 1 */
.octa 0x000000000ac2d90400000000ac81ef72
/* x^5120 mod p(x)` << 1, x^5184 mod p(x)` << 1 */
.octa 0x00000000fd226d140000000133212464
/* x^4096 mod p(x)` << 1, x^4160 mod p(x)` << 1 */
.octa 0x000000011cfd42e000000000e4e45610
/* x^3072 mod p(x)` << 1, x^3136 mod p(x)` << 1 */
.octa 0x000000016e5a5678000000000c1bd370
/* x^2048 mod p(x)` << 1, x^2112 mod p(x)` << 1 */
.octa 0x00000001d888fe2200000001a7b9e7a6
/* x^1024 mod p(x)` << 1, x^1088 mod p(x)` << 1 */
.octa 0x00000001af77fcd4000000007d657a10
SHORT_CONSTANTS:
/* Reduce final 1024-2048 bits to 64 bits, shifting 32 bits to include the trailing 32 bits of zeros */
/* x^1952 mod p(x)`, x^1984 mod p(x)`, x^2016 mod p(x)`, x^2048 mod p(x)` */
.octa 0xed837b2613e8221e99168a18ec447f11
/* x^1824 mod p(x)`, x^1856 mod p(x)`, x^1888 mod p(x)`, x^1920 mod p(x)` */
.octa 0xc8acdd8147b9ce5ae23e954e8fd2cd3c
/* x^1696 mod p(x)`, x^1728 mod p(x)`, x^1760 mod p(x)`, x^1792 mod p(x)` */
.octa 0xd9ad6d87d4277e2592f8befe6b1d2b53
/* x^1568 mod p(x)`, x^1600 mod p(x)`, x^1632 mod p(x)`, x^1664 mod p(x)` */
.octa 0xc10ec5e033fbca3bf38a3556291ea462
/* x^1440 mod p(x)`, x^1472 mod p(x)`, x^1504 mod p(x)`, x^1536 mod p(x)` */
.octa 0xc0b55b0e82e02e2f974ac56262b6ca4b
/* x^1312 mod p(x)`, x^1344 mod p(x)`, x^1376 mod p(x)`, x^1408 mod p(x)` */
.octa 0x71aa1df0e172334d855712b3784d2a56
/* x^1184 mod p(x)`, x^1216 mod p(x)`, x^1248 mod p(x)`, x^1280 mod p(x)` */
.octa 0xfee3053e3969324da5abe9f80eaee722
/* x^1056 mod p(x)`, x^1088 mod p(x)`, x^1120 mod p(x)`, x^1152 mod p(x)` */
.octa 0xf44779b93eb2bd081fa0943ddb54814c
/* x^928 mod p(x)`, x^960 mod p(x)`, x^992 mod p(x)`, x^1024 mod p(x)` */
.octa 0xf5449b3f00cc3374a53ff440d7bbfe6a
/* x^800 mod p(x)`, x^832 mod p(x)`, x^864 mod p(x)`, x^896 mod p(x)` */
.octa 0x6f8346e1d777606eebe7e3566325605c
/* x^672 mod p(x)`, x^704 mod p(x)`, x^736 mod p(x)`, x^768 mod p(x)` */
.octa 0xe3ab4f2ac0b95347c65a272ce5b592b8
/* x^544 mod p(x)`, x^576 mod p(x)`, x^608 mod p(x)`, x^640 mod p(x)` */
.octa 0xaa2215ea329ecc115705a9ca4721589f
/* x^416 mod p(x)`, x^448 mod p(x)`, x^480 mod p(x)`, x^512 mod p(x)` */
.octa 0x1ed8f66ed95efd26e3720acb88d14467
/* x^288 mod p(x)`, x^320 mod p(x)`, x^352 mod p(x)`, x^384 mod p(x)` */
.octa 0x78ed02d5a700e96aba1aca0315141c31
/* x^160 mod p(x)`, x^192 mod p(x)`, x^224 mod p(x)`, x^256 mod p(x)` */
.octa 0xba8ccbe832b39da3ad2a31b3ed627dae
/* x^32 mod p(x)`, x^64 mod p(x)`, x^96 mod p(x)`, x^128 mod p(x)` */
.octa 0xedb88320b1e6b0926655004fa06a2517
BARRETT_CONSTANTS:
/* 33 bit reflected Barrett constant m - (4^32)/n */
.octa 0x000000000000000000000001f7011641 /* x^64 div p(x)` */
/* 33 bit reflected Barrett constant n */
.octa 0x000000000000000000000001db710641
#endif /* __powerpc__ */
#endif

View file

@ -0,0 +1,75 @@
#ifdef __powerpc__
#define F crc32ieee_vpmsum
#define __F __crc32ieee_vpmsum
static const unsigned int crc_table[] = {
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d,};
#include "crc32_wrapper.ic"
#endif

View file

@ -395,7 +395,7 @@ parse_page(
}
if (per_page_details) {
printf("index %lu page %lu leaf %u n_recs %lu data_bytes %lu"
"\n", id, page_no, is_leaf, n_recs, data_bytes);
"\n", (ulong) id, (ulong) page_no, is_leaf, n_recs, data_bytes);
}
/* update per-index statistics */
{

View file

@ -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);
}

View file

@ -12,6 +12,12 @@ before calling SSL_new();
*** end Note ***
yaSSL Release notes, version 2.3.9b (2/03/2016)
This release of yaSSL fixes the OpenSSL compatibility function
X509_NAME_get_index_by_NID() to use the actual index of the common name
instead of searching on the format prefix. Thanks for the report from
yashwant.sahu@oracle.com . Anyone using this function should update.
yaSSL Release notes, version 2.3.9 (12/01/2015)
This release of yaSSL fixes two client side Diffie-Hellman problems.
yaSSL was only handling the cases of zero or one leading zeros for the key

View file

@ -34,7 +34,7 @@
#include "rsa.h"
#define YASSL_VERSION "2.3.9"
#define YASSL_VERSION "2.3.9b"
#if defined(__cplusplus)

View file

@ -191,14 +191,18 @@ private:
class X509_NAME {
char* name_;
size_t sz_;
int cnPosition_; // start of common name, -1 is none
int cnLen_; // length of above
ASN1_STRING entry_;
public:
X509_NAME(const char*, size_t sz);
X509_NAME(const char*, size_t sz, int pos, int len);
~X509_NAME();
const char* GetName() const;
ASN1_STRING* GetEntry(int i);
size_t GetLength() const;
int GetCnPosition() const { return cnPosition_; }
int GetCnLength() const { return cnLen_; }
private:
X509_NAME(const X509_NAME&); // hide copy
X509_NAME& operator=(const X509_NAME&); // and assign
@ -226,7 +230,7 @@ class X509 {
StringHolder afterDate_; // not valid after
public:
X509(const char* i, size_t, const char* s, size_t,
ASN1_STRING *b, ASN1_STRING *a);
ASN1_STRING *b, ASN1_STRING *a, int, int, int, int);
~X509() {}
X509_NAME* GetIssuer();

View file

@ -304,7 +304,10 @@ int CertManager::Validate()
afterDate.type= cert.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
peerX509_ = NEW_YS X509(cert.GetIssuer(), iSz, cert.GetCommonName(),
sSz, &beforeDate, &afterDate);
sSz, &beforeDate, &afterDate,
cert.GetIssuerCnStart(), cert.GetIssuerCnLength(),
cert.GetSubjectCnStart(), cert.GetSubjectCnLength()
);
if (err == TaoCrypt::SIG_OTHER_E && verifyCallback_) {
X509_STORE_CTX store;
@ -350,7 +353,9 @@ int CertManager::SetPrivateKey(const x509& key)
afterDate.type= cd.GetAfterDateType();
afterDate.length= strlen((char *) afterDate.data) + 1;
selfX509_ = NEW_YS X509(cd.GetIssuer(), iSz, cd.GetCommonName(),
sSz, &beforeDate, &afterDate);
sSz, &beforeDate, &afterDate,
cd.GetIssuerCnStart(), cd.GetIssuerCnLength(),
cd.GetSubjectCnStart(), cd.GetSubjectCnLength());
}
return 0;
}
@ -367,7 +372,9 @@ void CertManager::setPeerX509(X509* x)
ASN1_STRING* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->GetName(), subject->GetLength(), before, after);
subject->GetName(), subject->GetLength(), before, after,
issuer->GetCnPosition(), issuer->GetCnLength(),
subject->GetCnPosition(), subject->GetCnLength());
}

View file

@ -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

View file

@ -1351,15 +1351,13 @@ int ASN1_STRING_type(ASN1_STRING *x)
int X509_NAME_get_index_by_NID(X509_NAME* name,int nid, int lastpos)
{
int idx = -1; // not found
const char* start = &name->GetName()[lastpos + 1];
int cnPos = -1;
switch (nid) {
case NID_commonName:
const char* found = strstr(start, "/CN=");
if (found) {
found += 4; // advance to str
idx = found - start + lastpos + 1;
}
cnPos = name->GetCnPosition();
if (lastpos < cnPos)
idx = cnPos;
break;
}
@ -1471,10 +1469,6 @@ int SSL_peek(SSL* ssl, void* buffer, int sz)
int SSL_pending(SSL* ssl)
{
// Just in case there's pending data that hasn't been processed yet...
char c;
SSL_peek(ssl, &c, 1);
return ssl->bufferedData();
}

View file

@ -1554,8 +1554,9 @@ void SSL_SESSION::CopyX509(X509* x)
ASN1_TIME* after = x->GetAfter();
peerX509_ = NEW_YS X509(issuer->GetName(), issuer->GetLength(),
subject->GetName(), subject->GetLength(),
before, after);
subject->GetName(), subject->GetLength(), before, after,
issuer->GetCnPosition(), issuer->GetCnLength(),
subject->GetCnPosition(), subject->GetCnLength());
}
@ -2477,8 +2478,8 @@ void Security::set_resuming(bool b)
}
X509_NAME::X509_NAME(const char* n, size_t sz)
: name_(0), sz_(sz)
X509_NAME::X509_NAME(const char* n, size_t sz, int pos, int len)
: name_(0), sz_(sz), cnPosition_(pos), cnLen_(len)
{
if (sz) {
name_ = NEW_YS char[sz];
@ -2508,8 +2509,10 @@ size_t X509_NAME::GetLength() const
X509::X509(const char* i, size_t iSz, const char* s, size_t sSz,
ASN1_STRING *b, ASN1_STRING *a)
: issuer_(i, iSz), subject_(s, sSz),
ASN1_STRING *b, ASN1_STRING *a,
int issPos, int issLen,
int subPos, int subLen)
: issuer_(i, iSz, issPos, issLen), subject_(s, sSz, subPos, subLen),
beforeDate_((char *) b->data, b->length, b->type),
afterDate_((char *) a->data, a->length, a->type)
{}
@ -2544,17 +2547,19 @@ ASN1_STRING* X509_NAME::GetEntry(int i)
if (i < 0 || i >= int(sz_))
return 0;
if (i != cnPosition_ || cnLen_ <= 0) // only entry currently supported
return 0;
if (cnLen_ > int(sz_-i)) // make sure there's room in read buffer
return 0;
if (entry_.data)
ysArrayDelete(entry_.data);
entry_.data = NEW_YS byte[sz_]; // max size;
entry_.data = NEW_YS byte[cnLen_+1]; // max size;
memcpy(entry_.data, &name_[i], sz_ - i);
if (entry_.data[sz_ -i - 1]) {
entry_.data[sz_ - i] = 0;
entry_.length = int(sz_) - i;
}
else
entry_.length = int(sz_) - i - 1;
memcpy(entry_.data, &name_[i], cnLen_);
entry_.data[cnLen_] = 0;
entry_.length = cnLen_;
entry_.type = 0;
return &entry_;

View file

@ -285,6 +285,10 @@ public:
byte GetBeforeDateType() const { return beforeDateType_; }
const char* GetAfterDate() const { return afterDate_; }
byte GetAfterDateType() const { return afterDateType_; }
int GetSubjectCnStart() const { return subCnPos_; }
int GetIssuerCnStart() const { return issCnPos_; }
int GetSubjectCnLength() const { return subCnLen_; }
int GetIssuerCnLength() const { return issCnLen_; }
void DecodeToKey();
private:
@ -294,6 +298,10 @@ private:
word32 sigLength_; // length of signature
word32 signatureOID_; // sum of algorithm object id
word32 keyOID_; // sum of key algo object id
int subCnPos_; // subject common name start, -1 is none
int subCnLen_; // length of above
int issCnPos_; // issuer common name start, -1 is none
int issCnLen_; // length of above
byte subjectHash_[SHA_SIZE]; // hash of all Names
byte issuerHash_[SHA_SIZE]; // hash of all Names
byte* signature_;

View file

@ -482,8 +482,9 @@ void DH_Decoder::Decode(DH& key)
CertDecoder::CertDecoder(Source& s, bool decode, SignerList* signers,
bool noVerify, CertType ct)
: BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0),
signature_(0), verify_(!noVerify)
: BER_Decoder(s), certBegin_(0), sigIndex_(0), sigLength_(0), subCnPos_(-1),
subCnLen_(0), issCnPos_(-1), issCnLen_(0), signature_(0),
verify_(!noVerify)
{
issuer_[0] = 0;
subject_[0] = 0;
@ -804,6 +805,13 @@ void CertDecoder::GetName(NameType nt)
case COMMON_NAME:
if (!(ptr = AddTag(ptr, buf_end, "/CN=", 4, strLen)))
return;
if (nt == ISSUER) {
issCnPos_ = (int)(ptr - strLen - issuer_);
issCnLen_ = (int)strLen;
} else {
subCnPos_ = (int)(ptr - strLen - subject_);
subCnLen_ = (int)strLen;
}
break;
case SUR_NAME:
if (!(ptr = AddTag(ptr, buf_end, "/SN=", 4, strLen)))

View file

@ -27,7 +27,6 @@
#include <time.h>
#if defined(_WIN32)
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <wincrypt.h>
#else

View file

@ -470,10 +470,28 @@ inline void showPeer(SSL* ssl)
char* issuer = X509_NAME_oneline(X509_get_issuer_name(peer), 0, 0);
char* subject = X509_NAME_oneline(X509_get_subject_name(peer), 0, 0);
printf("peer's cert info:\n issuer : %s\n subject: %s\n", issuer,
subject);
X509_NAME_ENTRY* se = NULL;
ASN1_STRING* sd = NULL;
char* subCN = NULL;
X509_NAME* sub = X509_get_subject_name(peer);
int lastpos = -1;
if (sub)
lastpos = X509_NAME_get_index_by_NID(sub, NID_commonName, lastpos);
if (lastpos >= 0) {
se = X509_NAME_get_entry(sub, lastpos);
if (se)
sd = X509_NAME_ENTRY_get_data(se);
if (sd)
subCN = (char*)ASN1_STRING_data(sd);
}
printf("peer's cert info:\n issuer : %s\n subject: %s\n"
" subject cn: %s\n", issuer, subject, subCN);
free(subject);
free(issuer);
}
else
printf("peer has no cert!\n");

View file

@ -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)

View file

@ -68,11 +68,8 @@ typedef struct {
void *purgatory;
uint32 purgatory_count;
uint32 volatile link;
/* we want sizeof(LF_PINS) to be 128 to avoid false sharing */
char pad[128-sizeof(uint32)*2
-sizeof(LF_PINBOX *)
-sizeof(void*)
-sizeof(void *)*(LF_PINBOX_PINS+1)];
/* avoid false sharing */
char pad[CPU_LEVEL1_DCACHE_LINESIZE];
} LF_PINS;
/* compile-time assert to make sure we have enough pins. */

View file

@ -101,7 +101,7 @@ extern MY_UNICASE_INFO my_unicase_unicode520;
*/
#define MY_UCA_MAX_WEIGHT_SIZE (8+1) /* Including 0 terminator */
#define MY_UCA_CONTRACTION_MAX_WEIGHT_SIZE (2*8+1) /* Including 0 terminator */
#define MY_UCA_WEIGHT_LEVELS 1
#define MY_UCA_WEIGHT_LEVELS 2
typedef struct my_contraction_t
{
@ -131,6 +131,7 @@ typedef struct my_uca_level_info_st
uchar *lengths;
uint16 **weights;
MY_CONTRACTIONS contractions;
uint levelno;
} MY_UCA_WEIGHT_LEVEL;

View file

@ -23,6 +23,7 @@
#define _m_string_h
#include "my_global.h" /* HAVE_* */
#include "my_decimal_limits.h"
#ifndef __USE_GNU
#define __USE_GNU /* We want to use stpcpy */
@ -138,14 +139,13 @@ size_t my_fcvt(double x, int precision, char *to, my_bool *error);
size_t my_gcvt(double x, my_gcvt_arg_type type, int width, char *to,
my_bool *error);
#define NOT_FIXED_DEC 31
/*
The longest string my_fcvt can return is 311 + "precision" bytes.
Here we assume that we never cal my_fcvt() with precision >= NOT_FIXED_DEC
Here we assume that we never cal my_fcvt() with
precision >= DECIMAL_NOT_SPECIFIED
(+ 1 byte for the terminating '\0').
*/
#define FLOATING_POINT_BUFFER (311 + NOT_FIXED_DEC)
#define FLOATING_POINT_BUFFER (311 + DECIMAL_NOT_SPECIFIED)
/*
We want to use the 'e' format in some cases even if we have enough space

View file

@ -31,10 +31,16 @@
digits * number of decimal digits in one our big digit - number of decimal
digits in one our big digit decreased by 1 (because we always put decimal
point on the border of our big digits))
With normal precession we can handle 65 digits. MariaDB can store in
the .frm up to 63 digits. By default we use DECIMAL_NOT_SPECIFIED digits
when converting strings to decimal, so we don't want to set this too high.
To not use up all digits for the scale we limit the number of decimals to
38.
*/
#define DECIMAL_MAX_PRECISION (DECIMAL_MAX_POSSIBLE_PRECISION - 8*2)
#define DECIMAL_MAX_SCALE 30
#define DECIMAL_NOT_SPECIFIED 31
#define DECIMAL_MAX_SCALE 38
#define DECIMAL_NOT_SPECIFIED 39
/**
maximum length of string representation (number of maximum decimal

View file

@ -1232,4 +1232,22 @@ static inline double rint(double x)
#undef __GNUG__
#endif
/*
Provide defaults for the CPU cache line size, if it has not been detected by
CMake using getconf
*/
#if !defined(CPU_LEVEL1_DCACHE_LINESIZE) || CPU_LEVEL1_DCACHE_LINESIZE == 0
#if CPU_LEVEL1_DCACHE_LINESIZE == 0
#undef CPU_LEVEL1_DCACHE_LINESIZE
#endif
#if defined(__s390__)
#define CPU_LEVEL1_DCACHE_LINESIZE 256
#elif defined(__powerpc__) || defined(__aarch64__)
#define CPU_LEVEL1_DCACHE_LINESIZE 128
#else
#define CPU_LEVEL1_DCACHE_LINESIZE 64
#endif
#endif
#endif /* my_global_h */

View file

@ -54,26 +54,7 @@ typedef struct st_pthread_link {
We use native conditions on Vista and later, and fallback to own
implementation on earlier OS version.
*/
typedef union
{
/* Native condition (used on Vista and later) */
CONDITION_VARIABLE native_cond;
/* Own implementation (used on XP) */
struct
{
uint32 waiting;
CRITICAL_SECTION lock_waiting;
enum
{
SIGNAL= 0,
BROADCAST= 1,
MAX_EVENTS= 2
} EVENTS;
HANDLE events[MAX_EVENTS];
HANDLE broadcast_block_event;
};
} pthread_cond_t;
typedef CONDITION_VARIABLE pthread_cond_t;
typedef int pthread_mutexattr_t;
@ -81,10 +62,8 @@ typedef int pthread_mutexattr_t;
#define pthread_handler_t EXTERNC void * __cdecl
typedef void * (__cdecl *pthread_handler)(void *);
typedef volatile LONG my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT 0
#define MY_PTHREAD_ONCE_INPROGRESS 1
#define MY_PTHREAD_ONCE_DONE 2
typedef INIT_ONCE my_pthread_once_t;
#define MY_PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT;
#if !STRUCT_TIMESPEC_HAS_TV_SEC || !STRUCT_TIMESPEC_HAS_TV_NSEC
struct timespec {
@ -694,7 +673,7 @@ extern void my_mutex_end(void);
We need to have at least 256K stack to handle calls to myisamchk_init()
with the current number of keys and key parts.
*/
#define DEFAULT_THREAD_STACK (290*1024L)
#define DEFAULT_THREAD_STACK (291*1024L)
#endif
#define MY_PTHREAD_LOCK_READ 0
@ -712,7 +691,7 @@ struct st_my_thread_var
mysql_mutex_t * volatile current_mutex;
mysql_cond_t * volatile current_cond;
pthread_t pthread_self;
my_thread_id id;
my_thread_id id, dbug_id;
int volatile abort;
my_bool init;
struct st_my_thread_var *next,**prev;

View file

@ -23,6 +23,7 @@
#define _my_time_h_
#include "my_global.h"
#include "mysql_time.h"
#include "my_decimal_limits.h"
C_MODE_START
@ -184,7 +185,7 @@ void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type);
sent using binary protocol fit in this buffer.
*/
#define MAX_DATE_STRING_REP_LENGTH 30
#define AUTO_SEC_PART_DIGITS 31 /* same as NOT_FIXED_DEC */
#define AUTO_SEC_PART_DIGITS DECIMAL_NOT_SPECIFIED
int my_time_to_str(const MYSQL_TIME *l_time, char *to, uint digits);
int my_date_to_str(const MYSQL_TIME *l_time, char *to);

View file

@ -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

View file

@ -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;

View file

@ -367,7 +367,7 @@ void STDCALL mysql_server_end(void);
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
you don't need to call it explicitely; but you need to call
you don't need to call it explicitly; but you need to call
mysql_server_end() to free memory). The names are a bit misleading
(mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general
names which suit well whether you're using libmysqld or libmysqlclient. We

View file

@ -10,7 +10,10 @@ enum enum_server_command
COM_STMT_PREPARE, COM_STMT_EXECUTE, COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE,
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=253,
COM_MDB_GAP_END=250,
COM_SLAVE_WORKER,
COM_SLAVE_IO,
COM_SLAVE_SQL,
COM_MULTI,
COM_END
};

View file

@ -23,6 +23,10 @@
#include "plugin.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MYSQL_AUDIT_CLASS_MASK_SIZE 1
#define MYSQL_AUDIT_INTERFACE_VERSION 0x0302
@ -175,4 +179,8 @@ struct st_mysql_audit
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -31,6 +31,10 @@
#include <mysql/plugin_auth_common.h>
#ifdef __cplusplus
extern "C" {
#endif
/* defines for MYSQL_SERVER_AUTH_INFO.password_used */
#define PASSWORD_USED_NO 0
@ -122,5 +126,10 @@ struct st_mysql_auth
*/
int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info);
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -27,6 +27,10 @@
#include <mysql/plugin.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MariaDB_ENCRYPTION_INTERFACE_VERSION 0x0300
/**
@ -114,5 +118,9 @@ struct st_mariadb_encryption
*/
unsigned int (*encrypted_length)(unsigned int slen, unsigned int key_id, unsigned int key_version);
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -18,6 +18,10 @@
#define _my_plugin_ftparser_h
#include "plugin.h"
#ifdef __cplusplus
extern "C" {
#endif
/*************************************************************************
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
*/
@ -208,5 +212,9 @@ struct st_mysql_ftparser
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -26,6 +26,10 @@
#include <mysql/plugin.h>
#ifdef __cplusplus
extern "C" {
#endif
#define MariaDB_PASSWORD_VALIDATION_INTERFACE_VERSION 0x0100
/**
@ -41,5 +45,10 @@ struct st_mariadb_password_validation
int (*validate_password)(MYSQL_LEX_STRING *username,
MYSQL_LEX_STRING *password);
};
#ifdef __cplusplus
}
#endif
#endif

View file

@ -21,6 +21,8 @@
#ifndef _mysql_com_h
#define _mysql_com_h
#include "my_decimal_limits.h"
#define HOSTNAME_LENGTH 60
#define SYSTEM_CHARSET_MBMAXLEN 3
#define NAME_CHAR_LEN 64 /* Field/table name length */
@ -103,7 +105,10 @@ enum enum_server_command
COM_STMT_RESET, COM_SET_OPTION, COM_STMT_FETCH, COM_DAEMON,
/* don't forget to update const char *command_name[] in sql_parse.cc */
COM_MDB_GAP_BEG,
COM_MDB_GAP_END=253,
COM_MDB_GAP_END=250,
COM_SLAVE_WORKER,
COM_SLAVE_IO,
COM_SLAVE_SQL,
COM_MULTI,
/* Must be last */
COM_END
@ -156,8 +161,6 @@ enum enum_server_command
#define FIELD_FLAGS_COLUMN_FORMAT 24 /* Field column format, bit 24-25 */
#define FIELD_FLAGS_COLUMN_FORMAT_MASK (3 << FIELD_FLAGS_COLUMN_FORMAT)
#define FIELD_IS_DROPPED (1<< 26) /* Intern: Field is being dropped */
#define HAS_EXPLICIT_VALUE (1 << 27) /* An INSERT/UPDATE operation supplied
an explicit default value */
#define REFRESH_GRANT (1ULL << 0) /* Refresh grant tables */
#define REFRESH_LOG (1ULL << 1) /* Start on new log file */
@ -648,5 +651,18 @@ uchar *safe_net_store_length(uchar *pkg, size_t pkg_len, ulonglong length);
#define MYSQL_STMT_HEADER 4
#define MYSQL_LONG_DATA_HEADER 6
#define NOT_FIXED_DEC 31
/*
If a float or double field have more than this number of decimals,
it's regarded as floating point field without any specific number of
decimals
*/
#define FLOATING_POINT_DECIMALS 31
/* Keep client compatible with earlier versions */
#ifdef MYSQL_SERVER
#define NOT_FIXED_DEC DECIMAL_NOT_SPECIFIED
#else
#define NOT_FIXED_DEC FLOATING_POINT_DECIMALS
#endif
#endif

View file

@ -139,9 +139,10 @@ typedef struct st_thr_lock {
extern LIST *thr_lock_thread_list;
extern mysql_mutex_t THR_LOCK_lock;
struct st_my_thread_var;
my_bool init_thr_lock(void); /* Must be called once/thread */
void thr_lock_info_init(THR_LOCK_INFO *info);
void thr_lock_info_init(THR_LOCK_INFO *info, struct st_my_thread_var *tmp);
void thr_lock_init(THR_LOCK *lock);
void thr_lock_delete(THR_LOCK *lock);
void thr_lock_data_init(THR_LOCK *lock,THR_LOCK_DATA *data,

View file

@ -211,14 +211,6 @@ void vio_end(void);
#define SHUT_RD SD_RECEIVE
#endif
/*
Set thread id for io cancellation (required on Windows XP only,
and should to be removed if XP is no more supported)
*/
#define vio_set_thread_id(vio, tid) if(vio) vio->thread_id= tid
#else
#define vio_set_thread_id(vio, tid)
#endif
/* This enumerator is used in parser - should be always visible */
@ -288,7 +280,6 @@ struct st_vio
#ifdef _WIN32
HANDLE hPipe;
OVERLAPPED overlapped;
DWORD thread_id; /* Used on XP only by vio_shutdown() */
DWORD read_timeout_ms;
DWORD write_timeout_ms;
#endif

View file

@ -274,6 +274,25 @@ SET(CLIENT_API_FUNCTIONS
)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
IF (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING)
INCLUDE (CheckCSourceCompiles)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.ld"
"VERSION {\nlibmysqlclient_18 {\nglobal: *;\n};\n}\n")
SET(CMAKE_REQUIRED_LIBRARIES "-Wl,src.ld")
CHECK_C_SOURCE_COMPILES("int main() { return 0; }"
SUPPORTS_VERSION_IN_LINK_SCRIPT)
SET(CMAKE_REQUIRED_LIBRARIES)
IF (NOT SUPPORTS_VERSION_IN_LINK_SCRIPT)
# https://sourceware.org/bugzilla/show_bug.cgi?id=16895
MESSAGE(SEND_ERROR "Your current linker does not support VERSION "
"command in linker scripts like a GNU ld or any compatible linker "
"should. Perhaps you're using gold? Either switch to GNU ld compatible "
"linker or run cmake with -DDISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING=TRUE "
"to be able to complete the build")
ENDIF (NOT SUPPORTS_VERSION_IN_LINK_SCRIPT)
# When building RPM, or DEB package on Debian, use ELF symbol versioning
# for compatibility with distribution packages, so client shared library can
# painlessly replace the one supplied by the distribution.
@ -358,14 +377,26 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
make_scrambled_password_323
)
# Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529
SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in)
# Generate version script.
# Create semicolon separated lists of functions to export from
# Since RPM packages use separate versioning for 5.1 API
# and 5.5 API (libmysqlclient_16 vs libmysqlclient_18),
# we need 2 lists.
SET (VERSION_HEADER
"VERSION {
libmysqlclient_18 {
global:")
SET (VERSION_FOOTER
" local:
*;
};
libmysqlclient_16 {
/* empty here. aliases are added above */
};
}
")
SET (CLIENT_API_5_1_LIST)
SET (CLIENT_API_5_1_ALIASES)
FOREACH (f ${CLIENT_API_FUNCTIONS_5_1} ${CLIENT_API_5_1_EXTRA})
@ -378,6 +409,13 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(CLIENT_API_5_5_LIST "${CLIENT_API_5_5_LIST}\t${f};\n")
ENDFOREACH()
ELSE (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING)
SET (CLIENT_API_5_1_ALIASES "/* Versioning disabled per user request. MDEV-5982 */")
ENDIF (NOT DISABLE_LIBMYSQLCLIENT_SYMBOL_VERSIONING)
# Linker script to version symbols in Fedora- and Debian- compatible way, MDEV-5529
SET(VERSION_SCRIPT_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/libmysql_versions.ld.in)
CONFIGURE_FILE(
${VERSION_SCRIPT_TEMPLATE}
${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld
@ -386,7 +424,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(VERSION_SCRIPT_LINK_FLAGS
"-Wl,${CMAKE_CURRENT_BINARY_DIR}/libmysql_versions.ld")
ENDIF()
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(CLIENT_SOURCES
@ -406,7 +444,7 @@ ADD_CONVENIENCE_LIBRARY(clientlib ${CLIENT_SOURCES})
DTRACE_INSTRUMENT(clientlib)
ADD_DEPENDENCIES(clientlib GenError)
SET(LIBS clientlib dbug strings vio mysys mysys_ssl ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL})
SET(LIBS clientlib dbug strings vio mysys mysys_ssl ${ZLIB_LIBRARY} ${SSL_LIBRARIES} ${LIBDL} ${CRC32_VPMSUM_LIBRARY})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.

View file

@ -220,7 +220,7 @@ void STDCALL mysql_server_end()
}
#ifdef NOT_NEEDED
/*
The following is not needed as if the program explicitely called
The following is not needed as if the program explicitly called
my_init() then we can assume it will also call my_end().
The reason to not also do it here is in that case we can't get
statistics from my_end() to debug log.
@ -1510,9 +1510,8 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
*/
#ifdef EMBEDDED_LIBRARY
#define STMT_INIT_PREALLOC(S) 0
#else
#define STMT_INIT_PREALLOC(S) S
#undef MY_THREAD_SPECIFIC
#define MY_THREAD_SPECIFIC 0
#endif /*EMBEDDED_LIBRARY*/
MYSQL_STMT * STDCALL
@ -1533,10 +1532,8 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(NULL);
}
init_alloc_root(&stmt->mem_root, 2048, STMT_INIT_PREALLOC(2048),
MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->result.alloc, 4096, STMT_INIT_PREALLOC(4096),
MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->mem_root, 2048,2048, MYF(MY_THREAD_SPECIFIC));
init_alloc_root(&stmt->result.alloc, 4096, 4096, MYF(MY_THREAD_SPECIFIC));
stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
mysql->stmts= list_add(mysql->stmts, &stmt->list);
stmt->list.data= stmt;
@ -1553,8 +1550,6 @@ mysql_stmt_init(MYSQL *mysql)
DBUG_RETURN(stmt);
}
#undef STMT_INIT_PREALLOC
/*
Prepare server side statement with query.
@ -3479,7 +3474,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field,
*/
char buff[FLOATING_POINT_BUFFER];
size_t len;
if (field->decimals >= NOT_FIXED_DEC)
if (field->decimals >= FLOATING_POINT_DECIMALS)
len= my_gcvt(value, type,
(int) MY_MIN(sizeof(buff)-1, param->buffer_length),
buff, NULL);

View file

@ -27,19 +27,7 @@ mysql_get_charset_by_csname = get_charset_by_csname;
mysql_net_realloc = net_realloc;
mysql_client_errors = client_errors;
VERSION {
libmysqlclient_18 {
global:
@VERSION_HEADER@
@CLIENT_API_5_1_LIST@
@CLIENT_API_5_5_LIST@
local:
*;
};
libmysqlclient_16 {
/* empty here. aliases are added above */
};
}
@VERSION_FOOTER@

View file

@ -111,6 +111,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/wsrep_dummy.cc ../sql/encryption.cc
../sql/item_windowfunc.cc ../sql/sql_window.cc
../sql/sql_cte.cc
../sql/temporary_tables.cc
${GEN_SOURCES}
${MYSYS_LIBWRAP_SOURCE}
)
@ -124,8 +125,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()
@ -150,9 +155,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)
@ -179,7 +184,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)

View file

@ -426,7 +426,6 @@ static void emb_free_embedded_thd(MYSQL *mysql)
THD *thd= (THD*)mysql->thd;
mysql_mutex_lock(&LOCK_thread_count);
thd->clear_data_list();
thread_count--;
thd->store_globals();
thd->unlink();
mysql_mutex_unlock(&LOCK_thread_count);
@ -667,8 +666,7 @@ void init_embedded_mysql(MYSQL *mysql, int client_flag)
*/
void *create_embedded_thd(int client_flag)
{
THD * thd= new THD;
thd->thread_id= thd->variables.pseudo_thread_id= next_thread_id();
THD * thd= new THD(next_thread_id());
thd->thread_stack= (char*) &thd;
if (thd->store_globals())
@ -701,7 +699,6 @@ void *create_embedded_thd(int client_flag)
bzero((char*) &thd->net, sizeof(thd->net));
mysql_mutex_lock(&LOCK_thread_count);
thread_count++;
threads.append(thd);
mysql_mutex_unlock(&LOCK_thread_count);
thd->mysys_var= 0;
@ -1070,6 +1067,10 @@ bool Protocol::send_result_set_metadata(List<Item> *list, uint flags)
client_field->type= server_field.type;
client_field->flags= (uint16) server_field.flags;
client_field->decimals= server_field.decimals;
if (server_field.type == MYSQL_TYPE_FLOAT ||
server_field.type == MYSQL_TYPE_DOUBLE)
set_if_smaller(client_field->decimals, FLOATING_POINT_DECIMALS);
client_field->db_length= strlen(client_field->db);
client_field->table_length= strlen(client_field->table);
client_field->name_length= strlen(client_field->name);

View file

@ -126,7 +126,7 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
--disable_query_log
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535");
call mtr.add_suppression("Slave.*Can.t DROP .c7.; check that column.key exists.* error.* 1091");
call mtr.add_suppression("Slave.*Can.t DROP COLUMN .c7.; check that .* exists.* error.* 1091");
call mtr.add_suppression("Slave.*Unknown column .c7. in .t15.* error.* 1054");
call mtr.add_suppression("Slave.*Key column .c6. doesn.t exist in table.* error.* 1072");
call mtr.add_suppression("Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* error.* 1677");
@ -155,7 +155,7 @@ connection master;
f6 ENUM('a', 'b', 'c') default 'a',
f7 DECIMAL(17,9) default '1000.00',
f8 MEDIUMBLOB,
f9 NUMERIC(6,4) default '2000.00',
f9 NUMERIC(6,2) default '2000.00',
f10 VARCHAR(1024),
f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f12 SET('a', 'b', 'c') default 'b')
@ -178,7 +178,7 @@ connection master;
f5 DOUBLE DEFAULT '2.00',
f6 DECIMAL(17,9) default '1000.00',
f7 MEDIUMBLOB,
f8 NUMERIC(6,4) default '2000.00',
f8 NUMERIC(6,2) default '2000.00',
f9 VARCHAR(1024),
f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
f11 CHAR(255))

View file

@ -73,7 +73,7 @@ ALTER TABLE t8 ADD e1 INT NOT NULL DEFAULT 0, ADD e2 INT NOT NULL DEFAULT 0,
# the following INSERTs to pass the mode is switched temprorarily
set @@global.slave_exec_mode= 'IDEMPOTENT';
# so the inserts are going to be overriden
# so the inserts are going to be overridden
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');

View file

@ -1818,6 +1818,12 @@ SELECT f1() FROM t1 LEFT JOIN (SELECT 1 AS a FROM t1 LIMIT 0) AS d ON 1 GROUP BY
DROP FUNCTION f1;
DROP TABLE t1;
--echo #
--echo # MDEV-9662 Assertion `precision || !scale' failed in my_decimal_precision_to_length_no_truncation(uint, uint8, bool)
--echo #
SELECT @@collation_connection;
SELECT CASE 1 WHEN 2 THEN ( - '3' ) END;
--echo #
--echo # MDEV-5702 Incorrect results are returned with NULLIF()
--echo #

View file

@ -0,0 +1,156 @@
--echo #
--echo # Start of ctype_thai.inc
--echo #
#
# Test Unicode Thai collations based on libthai testcases
#
CREATE TABLE t1 (a VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_bin);
INSERT INTO t1 VALUES ('-กระแย่ง');
INSERT INTO t1 VALUES ('กก');
INSERT INTO t1 VALUES ('กราบ');
INSERT INTO t1 VALUES ('ข่าง');
INSERT INTO t1 VALUES ('ข้าง');
INSERT INTO t1 VALUES ('ข้างกระดาน');
INSERT INTO t1 VALUES ('ข้างขึ้น');
INSERT INTO t1 VALUES ('ข้างควาย');
INSERT INTO t1 VALUES ('ข้างเงิน');
INSERT INTO t1 VALUES ('ข้างแรม');
INSERT INTO t1 VALUES ('ข้างออก');
INSERT INTO t1 VALUES ('ข้างๆ');
INSERT INTO t1 VALUES ('ข้างๆ คูๆ');
INSERT INTO t1 VALUES ('ขาง');
INSERT INTO t1 VALUES ('แข็ง');
INSERT INTO t1 VALUES ('แข่ง');
INSERT INTO t1 VALUES ('แข่งขัน');
INSERT INTO t1 VALUES ('แข้ง');
INSERT INTO t1 VALUES ('แข้งขวา');
INSERT INTO t1 VALUES ('แข็งขัน');
INSERT INTO t1 VALUES ('ทูลเกล้า');
INSERT INTO t1 VALUES ('ทูลเกล้าทูลกระหม่อม');
INSERT INTO t1 VALUES ('ทูลเกล้าฯ');
INSERT INTO t1 VALUES ('บุญญา');
INSERT INTO t1 VALUES ('บุญ-หลง');
INSERT INTO t1 VALUES ('บุญหลง');
INSERT INTO t1 VALUES ('ป่า');
INSERT INTO t1 VALUES ('ป่าน');
INSERT INTO t1 VALUES ('ป้า');
INSERT INTO t1 VALUES ('ป้าน');
INSERT INTO t1 VALUES ('ป๊า');
INSERT INTO t1 VALUES ('ป๊าน');
INSERT INTO t1 VALUES ('ป๋า');
INSERT INTO t1 VALUES ('ป๋าน');
INSERT INTO t1 VALUES ('ปา');
INSERT INTO t1 VALUES ('ปาน');
INSERT INTO t1 VALUES ('แป้ง');
INSERT INTO t1 VALUES ('พณิชย์');
INSERT INTO t1 VALUES ('ม้า');
INSERT INTO t1 VALUES ('ฯพณฯ');
INSERT INTO t1 VALUES ('A');
INSERT INTO t1 VALUES ('a');
INSERT INTO t1 VALUES ('a\'');
INSERT INTO t1 VALUES ('A-');
INSERT INTO t1 VALUES ('a-');
INSERT INTO t1 VALUES ('-a');
INSERT INTO t1 VALUES ('A.');
INSERT INTO t1 VALUES ('a.');
INSERT INTO t1 VALUES ('A-1');
INSERT INTO t1 VALUES ('aa');
INSERT INTO t1 VALUES ('AA');
INSERT INTO t1 VALUES ('A.A.');
INSERT INTO t1 VALUES ('a.a.');
INSERT INTO t1 VALUES ('AAA');
INSERT INTO t1 VALUES ('A.A.A.');
INSERT INTO t1 VALUES ('AAAA');
INSERT INTO t1 VALUES ('A.A.A.L.');
INSERT INTO t1 VALUES ('A.A.A.S.');
INSERT INTO t1 VALUES ('Aachen');
INSERT INTO t1 VALUES ('A.A.E.');
INSERT INTO t1 VALUES ('A.Ae.E.');
INSERT INTO t1 VALUES ('A.A.E.E.');
INSERT INTO t1 VALUES ('AAES');
INSERT INTO t1 VALUES ('AAF');
INSERT INTO t1 VALUES ('A.Agr');
INSERT INTO t1 VALUES ('aah');
INSERT INTO t1 VALUES ('@@@@@');
INSERT INTO t1 VALUES ('0000');
INSERT INTO t1 VALUES ('9999');
INSERT INTO t1 VALUES ('Aalborg');
INSERT INTO t1 VALUES ('aide');
INSERT INTO t1 VALUES ('air');
INSERT INTO t1 VALUES ('@@@air');
INSERT INTO t1 VALUES ('air@@@');
INSERT INTO t1 VALUES ('C.A.F');
INSERT INTO t1 VALUES ('Canon');
INSERT INTO t1 VALUES ('coop');
INSERT INTO t1 VALUES ('co-op');
INSERT INTO t1 VALUES ('COOP');
INSERT INTO t1 VALUES ('CO-OP');
INSERT INTO t1 VALUES ('Copenhegen');
INSERT INTO t1 VALUES ('McArthur');
INSERT INTO t1 VALUES ('Mc Arthur');
INSERT INTO t1 VALUES ('Mc Mahon');
INSERT INTO t1 VALUES ('vice-president');
INSERT INTO t1 VALUES ('vice versa');
INSERT INTO t1 VALUES ('vice-versa');
INSERT INTO t1 VALUES ('10 ลิตร');
INSERT INTO t1 VALUES ('๑๐ ลิตร');
INSERT INTO t1 VALUES ('10 litre');
INSERT INTO t1 VALUES ('10 litre (10 ลิตร)');
INSERT INTO t1 VALUES ('10 ลิตร (10 litre)');
INSERT INTO t1 VALUES ('10 litre (๑๐ ลิตร)');
INSERT INTO t1 VALUES ('๑๐ ลิตร (10 litre)');
INSERT INTO t1 VALUES ('๑๐ ลิตร [10 litre]');
INSERT INTO t1 VALUES ('๑๐ ลิตร {10 litre}');
# Sort the table according to binary 'a'
# To avoid problems with unpredictable order or 'AA' and 'aa'
ALTER TABLE t1 ORDER BY a;
SET @backup_character_set_connection=@@character_set_connection;
SET @backup_collation_connection=@@collation_connection;
SET NAMES utf8;
SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a VARCHAR(30)',
' CHARACTER SET ', @backup_character_set_connection,
' COLLATE ', @backup_collation_connection,
' , ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
' , ADD KEY a_id (a, id)');
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET collation_connection=@backup_collation_connection;
SHOW CREATE TABLE t1;
--echo #
--echo # Ascending sort, using filesort
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a, BINARY a;
SELECT a FROM t1 ORDER BY a, BINARY a;
--echo #
--echo # Descending sort, using filesort
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
SELECT a FROM t1 ORDER BY a DESC, BINARY a DESC;
--echo #
--echo # Ascending sort, using index
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a, id;
SELECT a FROM t1 ORDER BY a, id;
--echo #
--echo # Descending sort, using index
--echo #
EXPLAIN SELECT a FROM t1 ORDER BY a DESC, id DESC;
SELECT a FROM t1 ORDER BY a DESC, id DESC;
DROP TABLE t1;
--echo #
--echo # End of ctype_thai.inc
--echo #

View file

@ -0,0 +1,65 @@
--echo #
--echo # Start of ctype_uca_w2.inc
--echo #
SELECT @@collation_connection;
SELECT ID, SORTLEN, COLLATION_NAME, CHARACTER_SET_NAME
FROM INFORMATION_SCHEMA.COLLATIONS
WHERE COLLATION_NAME LIKE @@collation_connection;
--echo #
--echo # Testing strnxfrm
--echo #
CREATE TABLE t1 AS SELECT SPACE(3) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (SPACE(0)),(SPACE(1)),(SPACE(2));
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(8))) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4))) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 1)) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 2)) FROM t1;
SELECT HEX(a), HEX(WEIGHT_STRING(a AS CHAR(4) LEVEL 3)) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (_ucs2 0x3400);
INSERT INTO t1 VALUES (_ucs2 0xF001);
SELECT HEX(CONVERT(a USING ucs2)) AS ucs2, HEX(a), HEX(WEIGHT_STRING(a)) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('A'),('À'),('Á'),('Â'),('Ã'),('Ä'),('Å');
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
SET @backup_character_set_connection=@@character_set_connection;
SET @backup_collation_connection=@@collation_connection;
SET NAMES utf8;
SET @stmt= CONCAT('ALTER TABLE t1 MODIFY a CHAR(10)' COLLATE utf8_bin,
' CHARACTER SET ', @backup_character_set_connection,
' COLLATE ', @backup_collation_connection);
PREPARE stmt FROM @stmt;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET collation_connection=@backup_collation_connection;
SHOW CREATE TABLE t1;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a;
SELECT a, HEX(WEIGHT_STRING(a LEVEL 2)) FROM t1 ORDER BY a DESC;
DROP TABLE t1;
CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0;
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('cota'),('cote'),('cotz');
INSERT INTO t1 VALUES ('coté'),('côte'),('côté'),('cotë'),('côtë');
SELECT * FROM t1 ORDER BY a;
SELECT * FROM t1 ORDER BY a DESC;
DROP TABLE t1;
--echo #
--echo # End of ctype_uca_w2.inc
--echo #

View file

@ -4,51 +4,43 @@ SET TIME_ZONE = "+00:00";
--echo # Test of errors for column data types that dont support function
--echo # defaults.
--echo #
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a BIT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a TINYINT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a SMALLINT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a INT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a BIGINT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a FLOAT DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a DECIMAL DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a DATE DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a TIME DEFAULT $current_timestamp );
--error ER_INVALID_DEFAULT
eval CREATE TABLE t1( a YEAR DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a BIT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a TINYINT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a SMALLINT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a MEDIUMINT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a INT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a BIGINT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a FLOAT DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a DECIMAL DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a DATE DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a TIME DEFAULT $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a YEAR DEFAULT $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a BIT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a BIT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a TINYINT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a TINYINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a SMALLINT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a SMALLINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a MEDIUMINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a INT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a INT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a BIGINT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a BIGINT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a FLOAT ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a FLOAT ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a DECIMAL ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a DECIMAL ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a DATE ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a DATE ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a TIME ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a TIME ON UPDATE $current_timestamp );
--error ER_INVALID_ON_UPDATE
eval CREATE TABLE t1( a YEAR ON UPDATE $current_timestamp );
eval CREATE OR REPLACE TABLE t1( a YEAR ON UPDATE $current_timestamp );
drop table if exists t1;
--echo #
--echo # Test that the default clause behaves like NOW() regarding time zones.

View file

@ -1,4 +1,5 @@
-- require r/have_crypt.require
disable_query_log;
show variables like 'have_crypt';
enable_query_log;
# encrypt('a') is NULL if crypt(3) is not available
# encrypt('a') is "*0" in fips mode
if (`select length(encrypt('a')) > 3 IS NOT TRUE`) {
skip No crypt(3);
}

View file

@ -0,0 +1,6 @@
# in the FIPS mode, OpenSSL disables DES and other weak algorithms
source include/have_ssl_crypto_functs.inc;
if (`select des_encrypt("a", "b") IS NULL`) {
skip DES is disabled (fips mode?);
}

View file

@ -54,7 +54,7 @@
# Set the SESSION DEFAULT STORAGE ENGINE to a value <> storage engine
# to be tested. This must not affect any CREATE TABLE statement, where
# the storage engine is assigned explicitely,
# the storage engine is assigned explicitly,
eval SET SESSION STORAGE_ENGINE = $other_engine_type;
#

View file

@ -129,10 +129,10 @@ my $config3= My::Config->new($test_include_cnf);
isa_ok( $config3, "My::Config" );
print $config3;
is( $config3->value('mysqld', 'basedir'), 'anotherbasedir',
"mysqld_basedir has been overriden by value in test_include.cnf");
"mysqld_basedir has been overridden by value in test_include.cnf");
is( $config3->value('mysqld', 'option1'), 'values3',
"mysqld_option1 has been overriden by value in test_include.cnf");
"mysqld_option1 has been overridden by value in test_include.cnf");
is( $config3->value('mysqld', 'option2'), 'value4',
"mysqld_option2 is from included file");

View file

@ -638,7 +638,7 @@ sub command_line_setup () {
if (! -f $glob_scriptname)
{
mtr_error("Can't find the location for the mysql-test-run script\n" .
"Go to to the mysql-test directory and execute the script " .
"Go to the mysql-test directory and execute the script " .
"as follows:\n./$glob_scriptname");
}
@ -4133,7 +4133,7 @@ sub valgrind_arguments {
if -f "$glob_mysql_test_dir/valgrind.supp";
}
# Add valgrind options, can be overriden by user
# Add valgrind options, can be overridden by user
mtr_add_arg($args, '%s', $_) for (@valgrind_args);
mtr_add_arg($args, $$exe);

View file

@ -1079,7 +1079,7 @@ sub log_session_errors
{
lock ($log_file_lock);
#header in the begining of log file
#header in the beginning of log file
if (!-e $stress_log_file)
{
stress_log($stress_log_file,

View file

@ -1385,7 +1385,7 @@ sub command_line_setup {
if ( @opt_cases )
{
# Run big tests if explicitely specified on command line
# Run big tests if explicitly specified on command line
$opt_big_test= 1;
}
@ -1783,9 +1783,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");
}
@ -1854,11 +1857,17 @@ sub collect_mysqld_features {
$list =~ s/\n {22}(\S)/ $1/g;
my @list= split '\n', $list;
$mysql_version_id= 0;
while (defined(my $line = shift @list)){
if ($line =~ /^\Q$exe_mysqld\E\s+Ver\s(\d+)\.(\d+)\.(\d+)(\S*)/ ) {
$mysql_version_id= $1*10000 + $2*100 + $3;
mtr_report("MariaDB Version $1.$2.$3$4");
last;
}
}
mtr_error("Could not find version of MariaDB")
unless shift(@list) =~ /^\Q$exe_mysqld\E\s+Ver\s(\d+)\.(\d+)\.(\d+)(\S*)/;
$mysql_version_id= $1*10000 + $2*100 + $3;
$mysql_version_extra= $4;
mtr_report("MariaDB Version $1.$2.$3$4");
unless $mysql_version_id > 0;
for (@list)
{
@ -3222,7 +3231,7 @@ sub mysql_install_db {
# Create mtr database
mtr_tofile($bootstrap_sql_file,
"CREATE DATABASE mtr;\n");
"CREATE DATABASE mtr CHARSET=latin1;\n");
# Add help tables and data for warning detection and supression
mtr_tofile($bootstrap_sql_file,
@ -5841,7 +5850,7 @@ sub valgrind_arguments {
}
}
# Add valgrind options, can be overriden by user
# Add valgrind options, can be overridden by user
mtr_add_arg($args, '%s', $_) for (@valgrind_args);
mtr_add_arg($args, $$exe);
@ -5868,7 +5877,7 @@ sub strace_arguments {
mtr_add_arg($args, "-f");
mtr_add_arg($args, "-o%s/var/log/%s.strace", $glob_mysql_test_dir, $mysqld_name);
# Add strace options, can be overriden by user
# Add strace options, can be overridden by user
mtr_add_arg($args, '%s', $_) for (@strace_args);
mtr_add_arg($args, $$exe);

View file

@ -393,15 +393,15 @@ default charset latin1 collate latin1_general_cs;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`myblob` longblob,
`mytext` longtext COLLATE latin1_general_cs
`myblob` longblob DEFAULT NULL,
`mytext` longtext COLLATE latin1_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs
alter table t1 character set latin2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`myblob` longblob,
`mytext` longtext CHARACTER SET latin1 COLLATE latin1_general_cs
`myblob` longblob DEFAULT NULL,
`mytext` longtext CHARACTER SET latin1 COLLATE latin1_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin2
drop table t1;
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
@ -414,12 +414,12 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 DROP PRIMARY KEY;
ERROR 42000: Can't DROP 'PRIMARY'; check that column/key exists
ERROR 42000: Can't DROP INDEX `PRIMARY`; check that it exists
DROP TABLE t1;
create table t1 (a int, b int, key(a));
insert into t1 values (1,1), (2,2);
alter table t1 drop key no_such_key;
ERROR 42000: Can't DROP 'no_such_key'; check that column/key exists
ERROR 42000: Can't DROP INDEX `no_such_key`; check that it exists
alter table t1 drop key a;
drop table t1;
CREATE TABLE T12207(a int) ENGINE=MYISAM;
@ -900,7 +900,7 @@ alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text
`a` text DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
create table t1 (a mediumtext character set latin1);
@ -908,7 +908,7 @@ alter table t1 convert to character set utf8;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` longtext
`a` longtext DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
drop table t1;
End of 5.0 tests
@ -1374,7 +1374,7 @@ Note 1060 Duplicate column name 'lol'
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
Warnings:
Note 1091 Can't DROP 'lol'; check that column/key exists
Note 1091 Can't DROP COLUMN `lol`; check that it exists
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
Warnings:
@ -1385,7 +1385,7 @@ Note 1054 Unknown column 'lol' in 't1'
DROP INDEX IF EXISTS x_param ON t1;
DROP INDEX IF EXISTS x_param ON t1;
Warnings:
Note 1091 Can't DROP 'x_param'; check that column/key exists
Note 1091 Can't DROP INDEX `x_param`; check that it exists
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
Warnings:
@ -1416,7 +1416,7 @@ Note 1060 Duplicate column name 'lol'
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
Warnings:
Note 1091 Can't DROP 'lol'; check that column/key exists
Note 1091 Can't DROP COLUMN `lol`; check that it exists
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
Warnings:
@ -1427,7 +1427,7 @@ Note 1054 Unknown column 'lol' in 't1'
DROP INDEX IF EXISTS x_param ON t1;
DROP INDEX IF EXISTS x_param ON t1;
Warnings:
Note 1091 Can't DROP 'x_param'; check that column/key exists
Note 1091 Can't DROP INDEX `x_param`; check that it exists
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
Warnings:
@ -1447,7 +1447,7 @@ Note 1061 Duplicate key name 'fk'
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk;
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk;
Warnings:
Note 1091 Can't DROP 'fk'; check that column/key exists
Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@ -1461,7 +1461,7 @@ Note 1061 Duplicate key name 't2_ibfk_1'
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1;
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1;
Warnings:
Note 1091 Can't DROP 't2_ibfk_1'; check that column/key exists
Note 1091 Can't DROP FOREIGN KEY `t2_ibfk_1`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@ -1486,10 +1486,10 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t2 DROP KEY k_id, DROP KEY IF EXISTS k_id;
Warnings:
Note 1091 Can't DROP 'k_id'; check that column/key exists
Note 1091 Can't DROP INDEX `k_id`; check that it exists
ALTER TABLE t2 DROP COLUMN a, DROP COLUMN IF EXISTS a;
Warnings:
Note 1091 Can't DROP 'a'; check that column/key exists
Note 1091 Can't DROP COLUMN `a`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@ -1504,7 +1504,7 @@ ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`transaction_id` int(11) NOT NULL DEFAULT '0',
`transaction_id` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`transaction_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
@ -1667,6 +1667,8 @@ ALTER TABLE m1 ENABLE KEYS, ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
affected rows: 0
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: COPY algorithm requires a lock. Try LOCK=SHARED.
ALTER ONLINE TABLE m1 ADD COLUMN c int;
ERROR 0A000: LOCK=NONE is not supported for this operation. Try LOCK=SHARED.
ALTER TABLE m1 ENABLE KEYS, ALGORITHM= COPY, LOCK= SHARED;
affected rows: 2
info: Records: 2 Duplicates: 0 Warnings: 0

View file

@ -10,10 +10,10 @@ drop index `primary` on lineitem;
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,

View file

@ -10,10 +10,10 @@ drop index `primary` on lineitem;
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -39,10 +39,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -80,10 +80,10 @@ ERROR 23000: Duplicate entry '1-2' for key 'PRIMARY'
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,
@ -114,10 +114,10 @@ alter table lineitem add primary key (l_orderkey, l_linenumber);
show create table lineitem;
Table Create Table
lineitem CREATE TABLE `lineitem` (
`l_orderkey` int(11) NOT NULL DEFAULT '0',
`l_orderkey` int(11) NOT NULL DEFAULT 0,
`l_partkey` int(11) DEFAULT NULL,
`l_suppkey` int(11) DEFAULT NULL,
`l_linenumber` int(11) NOT NULL DEFAULT '0',
`l_linenumber` int(11) NOT NULL DEFAULT 0,
`l_quantity` double DEFAULT NULL,
`l_extendedprice` double DEFAULT NULL,
`l_discount` double DEFAULT NULL,

View file

@ -1,4 +1,3 @@
drop table if exists t1,t2,t3;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
@ -62,6 +61,18 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
create table t1 (i int) partition by hash(i) partitions 2;
alter online table t1 comment 'test';
drop table t1;
create table t1 (a int);
alter online table t1 modify a int comment 'test';
drop table t1;
create table t1 (a int) engine=innodb;
alter online table t1 modify a int comment 'test';
drop table t1;
create table t1 (a int) partition by hash(a) partitions 2;
alter online table t1 modify a int comment 'test';
drop table t1;
#
# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
#

View file

@ -385,7 +385,7 @@ def -((9223372036854775808)) 8 20 20 N 32897 0 63
-9223372036854775808
select -(-(9223372036854775808));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -(-(9223372036854775808)) 246 21 19 N 32897 0 63
def -(-(9223372036854775808)) 246 20 19 N 32897 0 63
-(-(9223372036854775808))
9223372036854775808
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
@ -502,3 +502,9 @@ a
SELECT * FROM t1 WHERE a IN (0.8,0.9);
a
DROP TABLE t1;
#
# MDEV-9372 select 100 between 1 and 9223372036854775808 returns false
#
SELECT 100 BETWEEN 1 AND 9223372036854775808;
100 BETWEEN 1 AND 9223372036854775808
1

View file

@ -33,7 +33,7 @@ like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/fi
into @count_read_after;
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
0.000000000000000000000000000000
0.00000000000000000000000000000000000000
show full tables;
Tables_in_show_table_lw_db Table_type
t1 BASE TABLE
@ -51,6 +51,6 @@ like "%show_table_lw_db%" AND FILE_NAME like "%.frm%" AND EVENT_NAME='wait/io/fi
into @count_read_after;
select @count_read_after-@count_read_before;
@count_read_after-@count_read_before
10.000000000000000000000000000000
10.00000000000000000000000000000000000000
drop table t1;
drop database show_table_lw_db;

View file

@ -18,7 +18,7 @@ info: Records: 0 Duplicates: 0 Warnings: 0
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT '10'
`a` int(11) DEFAULT 10
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#

View file

@ -8,4 +8,17 @@ a
Warnings:
Note 1003 2000-01-01
Note 1003 2000-01-06
set debug_dbug='';
drop table t1;
create table t1 (id int not null, ut timestamp(6) not null);
insert into t1 values(1, '2001-01-01 00:00:00.2');
insert into t1 values(1, '2001-01-01 00:00:00.1');
select * from t1;
id ut
1 2001-01-01 00:00:00.200000
1 2001-01-01 00:00:00.100000
select (select max(m2.ut) from t1 m2 where m1.id <> 0) from t1 m1;
(select max(m2.ut) from t1 m2 where m1.id <> 0)
2001-01-01 00:00:00.200000
2001-01-01 00:00:00.200000
drop table t1;

Some files were not shown because too many files have changed in this diff Show more