Loading Docs/manual.texi +6 −0 Original line number Diff line number Diff line Loading @@ -14374,12 +14374,16 @@ like an integer (64-bit precision). In string context these act like a binary string where each pair of hex digits is converted to a character: @example mysql> SELECT x'FF' -> 255 mysql> SELECT 0xa+0; -> 10 mysql> select 0x5061756c; -> Paul @end example The x'hexstring' syntax (new in 4.0) is based on ANSI SQL and the 0x syntax is based on ODBC. Hexadecimal strings are often used by ODBC to give values for BLOB columns. @tindex NULL value Loading Loading @@ -46427,6 +46431,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Allow ANSI SQL syntax @code{X'hexadecimal-number'} @item Added @code{ALTER TABLE table_name DISABLE KEYS} and @code{ALTER TABLE table_name ENABLE KEYS} commands. @item client/mysqldump.c +13 −13 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> **/ #define DUMP_VERSION "8.14" #define DUMP_VERSION "8.15" #include <global.h> #include <my_sys.h> Loading Loading @@ -274,12 +274,12 @@ puts("\ static void write_heder(FILE *sql_file, char *db_name) { fprintf(sql_file, "# MySQL dump %s\n#\n", DUMP_VERSION); fprintf(sql_file, "# Host: %s Database: %s\n", fprintf(sql_file, "-- MySQL dump %s\n#\n", DUMP_VERSION); fprintf(sql_file, "-- Host: %s Database: %s\n", current_host ? current_host : "localhost", db_name ? db_name : ""); fputs("#--------------------------------------------------------\n", fputs("---------------------------------------------------------\n", sql_file); fprintf(sql_file, "# Server version\t%s\n", fprintf(sql_file, "-- Server version\t%s\n", mysql_get_server_info(&mysql_connection)); return; } /* write_heder */ Loading Loading @@ -515,7 +515,7 @@ static int dbConnect(char *host, char *user,char *passwd) DBUG_ENTER("dbConnect"); if (verbose) { fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost"); fprintf(stderr, "-- Connecting to %s...\n", host ? host : "localhost"); } mysql_init(&mysql_connection); if (opt_compress) Loading @@ -542,7 +542,7 @@ static int dbConnect(char *host, char *user,char *passwd) static void dbDisconnect(char *host) { if (verbose) fprintf(stderr, "# Disconnecting from %s...\n", host ? host : "localhost"); fprintf(stderr, "-- Disconnecting from %s...\n", host ? host : "localhost"); mysql_close(sock); } /* dbDisconnect */ Loading Loading @@ -608,7 +608,7 @@ static uint getTableStructure(char *table, char* db) delayed= opt_delayed ? " DELAYED " : ""; if (verbose) fprintf(stderr, "# Retrieving table structure for table %s...\n", table); fprintf(stderr, "-- Retrieving table structure for table %s...\n", table); sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", opt_quoted); table_name=quote_name(table,table_buff); Loading Loading @@ -837,7 +837,7 @@ static uint getTableStructure(char *table, char* db) { /* If old MySQL version */ if (verbose) fprintf(stderr, "# Warning: Couldn't get status information for table '%s' (%s)\n", "-- Warning: Couldn't get status information for table '%s' (%s)\n", table,mysql_error(sock)); } } Loading Loading @@ -934,7 +934,7 @@ static void dumpTable(uint numFields, char *table) ulong rownr, row_break, total_length, init_length; if (verbose) fprintf(stderr, "# Sending SELECT query...\n"); fprintf(stderr, "-- Sending SELECT query...\n"); if (path) { char filename[FN_REFLEN], tmp_path[FN_REFLEN]; Loading Loading @@ -977,10 +977,10 @@ static void dumpTable(uint numFields, char *table) sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff)); if (where) { fprintf(result_file,"# WHERE: %s\n",where); fprintf(result_file,"-- WHERE: %s\n",where); strxmov(strend(query), " WHERE ",where,NullS); } fputs("#\n\n", result_file); fputs("\n\n", result_file); if (mysql_query(sock, query)) { Loading @@ -997,7 +997,7 @@ static void dumpTable(uint numFields, char *table) return; } if (verbose) fprintf(stderr, "# Retrieving rows...\n"); fprintf(stderr, "-- Retrieving rows...\n"); if (mysql_num_fields(res) != numFields) { fprintf(stderr,"%s: Error in field count for table: '%s' ! Aborting.\n", Loading libmysql/libmysql.c +8 −13 Original line number Diff line number Diff line Loading @@ -322,17 +322,9 @@ net_safe_read(MYSQL *mysql) if (len > 3) { char *pos=(char*) net->read_pos+1; if (mysql->protocol_version > 9) { /* New client protocol */ net->last_errno=uint2korr(pos); pos+=2; len-=2; } else { net->last_errno=CR_UNKNOWN_ERROR; len--; } (void) strmake(net->last_error,(char*) pos, min(len,sizeof(net->last_error)-1)); } Loading Loading @@ -1404,6 +1396,7 @@ mysql_ssl_clear(MYSQL *mysql) ** If host == 0 then use localhost **************************************************************************/ #ifdef USE_OLD_FUNCTIONS MYSQL * STDCALL mysql_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd) Loading @@ -1420,6 +1413,7 @@ mysql_connect(MYSQL *mysql,const char *host, DBUG_RETURN(res); } } #endif /* Loading Loading @@ -1651,8 +1645,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_DUMP("packet",(char*) net->read_pos,10); DBUG_PRINT("info",("mysql protocol version %d, server=%d", PROTOCOL_VERSION, mysql->protocol_version)); if (mysql->protocol_version != PROTOCOL_VERSION && mysql->protocol_version != PROTOCOL_VERSION-1) if (mysql->protocol_version != PROTOCOL_VERSION) { net->last_errno= CR_VERSION_ERROR; sprintf(net->last_error, ER(CR_VERSION_ERROR), mysql->protocol_version, Loading Loading @@ -2547,6 +2540,7 @@ mysql_list_processes(MYSQL *mysql) } #ifdef USE_OLD_FUNCTIONS int STDCALL mysql_create_db(MYSQL *mysql, const char *db) { Loading @@ -2563,6 +2557,7 @@ mysql_drop_db(MYSQL *mysql, const char *db) DBUG_PRINT("enter",("db: %s",db)); DBUG_RETURN(simple_command(mysql,COM_DROP_DB,db,(uint) strlen(db),0)); } #endif int STDCALL Loading myisam/myisamchk.c +0 −2 Original line number Diff line number Diff line Loading @@ -258,8 +258,6 @@ static void usage(void) -k, --keys-used=# Tell MyISAM to update only some specific keys. # is a\n\ bit mask of which keys to use. This can be used to\n\ get faster inserts!\n\ -l, --no-symlinks Do not follow symbolic links. Normally\n\ myisamchk repairs the table a symlink points at.\n\ -r, --recover Can fix almost anything except unique keys that aren't\n\ unique.\n\ -n, --sort-recover Force recovering with sorting even if the temporary\n\ Loading mysql-test/r/varbinary.result +4 −0 Original line number Diff line number Diff line Loading @@ -2,5 +2,9 @@ A 65 9223372036854775807 -1 0x31+1 concat(0x31)+1 -0xf 50 2 -15 x'31' X'ffff'+0 1 65535 table type possible_keys key key_len ref rows Extra t1 const UNIQ UNIQ 8 const 1 x xx 1 2 Loading
Docs/manual.texi +6 −0 Original line number Diff line number Diff line Loading @@ -14374,12 +14374,16 @@ like an integer (64-bit precision). In string context these act like a binary string where each pair of hex digits is converted to a character: @example mysql> SELECT x'FF' -> 255 mysql> SELECT 0xa+0; -> 10 mysql> select 0x5061756c; -> Paul @end example The x'hexstring' syntax (new in 4.0) is based on ANSI SQL and the 0x syntax is based on ODBC. Hexadecimal strings are often used by ODBC to give values for BLOB columns. @tindex NULL value Loading Loading @@ -46427,6 +46431,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}. @itemize @bullet @item Allow ANSI SQL syntax @code{X'hexadecimal-number'} @item Added @code{ALTER TABLE table_name DISABLE KEYS} and @code{ALTER TABLE table_name ENABLE KEYS} commands. @item
client/mysqldump.c +13 −13 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ ** Tnu Samuel <tonu@please.do.not.remove.this.spam.ee> **/ #define DUMP_VERSION "8.14" #define DUMP_VERSION "8.15" #include <global.h> #include <my_sys.h> Loading Loading @@ -274,12 +274,12 @@ puts("\ static void write_heder(FILE *sql_file, char *db_name) { fprintf(sql_file, "# MySQL dump %s\n#\n", DUMP_VERSION); fprintf(sql_file, "# Host: %s Database: %s\n", fprintf(sql_file, "-- MySQL dump %s\n#\n", DUMP_VERSION); fprintf(sql_file, "-- Host: %s Database: %s\n", current_host ? current_host : "localhost", db_name ? db_name : ""); fputs("#--------------------------------------------------------\n", fputs("---------------------------------------------------------\n", sql_file); fprintf(sql_file, "# Server version\t%s\n", fprintf(sql_file, "-- Server version\t%s\n", mysql_get_server_info(&mysql_connection)); return; } /* write_heder */ Loading Loading @@ -515,7 +515,7 @@ static int dbConnect(char *host, char *user,char *passwd) DBUG_ENTER("dbConnect"); if (verbose) { fprintf(stderr, "# Connecting to %s...\n", host ? host : "localhost"); fprintf(stderr, "-- Connecting to %s...\n", host ? host : "localhost"); } mysql_init(&mysql_connection); if (opt_compress) Loading @@ -542,7 +542,7 @@ static int dbConnect(char *host, char *user,char *passwd) static void dbDisconnect(char *host) { if (verbose) fprintf(stderr, "# Disconnecting from %s...\n", host ? host : "localhost"); fprintf(stderr, "-- Disconnecting from %s...\n", host ? host : "localhost"); mysql_close(sock); } /* dbDisconnect */ Loading Loading @@ -608,7 +608,7 @@ static uint getTableStructure(char *table, char* db) delayed= opt_delayed ? " DELAYED " : ""; if (verbose) fprintf(stderr, "# Retrieving table structure for table %s...\n", table); fprintf(stderr, "-- Retrieving table structure for table %s...\n", table); sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", opt_quoted); table_name=quote_name(table,table_buff); Loading Loading @@ -837,7 +837,7 @@ static uint getTableStructure(char *table, char* db) { /* If old MySQL version */ if (verbose) fprintf(stderr, "# Warning: Couldn't get status information for table '%s' (%s)\n", "-- Warning: Couldn't get status information for table '%s' (%s)\n", table,mysql_error(sock)); } } Loading Loading @@ -934,7 +934,7 @@ static void dumpTable(uint numFields, char *table) ulong rownr, row_break, total_length, init_length; if (verbose) fprintf(stderr, "# Sending SELECT query...\n"); fprintf(stderr, "-- Sending SELECT query...\n"); if (path) { char filename[FN_REFLEN], tmp_path[FN_REFLEN]; Loading Loading @@ -977,10 +977,10 @@ static void dumpTable(uint numFields, char *table) sprintf(query, "SELECT * FROM %s", quote_name(table,table_buff)); if (where) { fprintf(result_file,"# WHERE: %s\n",where); fprintf(result_file,"-- WHERE: %s\n",where); strxmov(strend(query), " WHERE ",where,NullS); } fputs("#\n\n", result_file); fputs("\n\n", result_file); if (mysql_query(sock, query)) { Loading @@ -997,7 +997,7 @@ static void dumpTable(uint numFields, char *table) return; } if (verbose) fprintf(stderr, "# Retrieving rows...\n"); fprintf(stderr, "-- Retrieving rows...\n"); if (mysql_num_fields(res) != numFields) { fprintf(stderr,"%s: Error in field count for table: '%s' ! Aborting.\n", Loading
libmysql/libmysql.c +8 −13 Original line number Diff line number Diff line Loading @@ -322,17 +322,9 @@ net_safe_read(MYSQL *mysql) if (len > 3) { char *pos=(char*) net->read_pos+1; if (mysql->protocol_version > 9) { /* New client protocol */ net->last_errno=uint2korr(pos); pos+=2; len-=2; } else { net->last_errno=CR_UNKNOWN_ERROR; len--; } (void) strmake(net->last_error,(char*) pos, min(len,sizeof(net->last_error)-1)); } Loading Loading @@ -1404,6 +1396,7 @@ mysql_ssl_clear(MYSQL *mysql) ** If host == 0 then use localhost **************************************************************************/ #ifdef USE_OLD_FUNCTIONS MYSQL * STDCALL mysql_connect(MYSQL *mysql,const char *host, const char *user, const char *passwd) Loading @@ -1420,6 +1413,7 @@ mysql_connect(MYSQL *mysql,const char *host, DBUG_RETURN(res); } } #endif /* Loading Loading @@ -1651,8 +1645,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, DBUG_DUMP("packet",(char*) net->read_pos,10); DBUG_PRINT("info",("mysql protocol version %d, server=%d", PROTOCOL_VERSION, mysql->protocol_version)); if (mysql->protocol_version != PROTOCOL_VERSION && mysql->protocol_version != PROTOCOL_VERSION-1) if (mysql->protocol_version != PROTOCOL_VERSION) { net->last_errno= CR_VERSION_ERROR; sprintf(net->last_error, ER(CR_VERSION_ERROR), mysql->protocol_version, Loading Loading @@ -2547,6 +2540,7 @@ mysql_list_processes(MYSQL *mysql) } #ifdef USE_OLD_FUNCTIONS int STDCALL mysql_create_db(MYSQL *mysql, const char *db) { Loading @@ -2563,6 +2557,7 @@ mysql_drop_db(MYSQL *mysql, const char *db) DBUG_PRINT("enter",("db: %s",db)); DBUG_RETURN(simple_command(mysql,COM_DROP_DB,db,(uint) strlen(db),0)); } #endif int STDCALL Loading
myisam/myisamchk.c +0 −2 Original line number Diff line number Diff line Loading @@ -258,8 +258,6 @@ static void usage(void) -k, --keys-used=# Tell MyISAM to update only some specific keys. # is a\n\ bit mask of which keys to use. This can be used to\n\ get faster inserts!\n\ -l, --no-symlinks Do not follow symbolic links. Normally\n\ myisamchk repairs the table a symlink points at.\n\ -r, --recover Can fix almost anything except unique keys that aren't\n\ unique.\n\ -n, --sort-recover Force recovering with sorting even if the temporary\n\ Loading
mysql-test/r/varbinary.result +4 −0 Original line number Diff line number Diff line Loading @@ -2,5 +2,9 @@ A 65 9223372036854775807 -1 0x31+1 concat(0x31)+1 -0xf 50 2 -15 x'31' X'ffff'+0 1 65535 table type possible_keys key key_len ref rows Extra t1 const UNIQ UNIQ 8 const 1 x xx 1 2