Loading .bzrignore +3 −0 Original line number Diff line number Diff line Loading @@ -940,3 +940,6 @@ ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid ndb/tools/ndb_restore ac_available_languages_fragment libmysqld/ha_archive.cc libmysqld/ha_example.cc libmysqld/ha_tina.cc client/mysqladmin.cc +9 −2 Original line number Diff line number Diff line Loading @@ -825,10 +825,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } if (argv[1][0]) { char *pw= argv[1]; #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') printf("Warning: single quotes were not trimmed from the password by" " your command\nline client, as you might have expected.\n"); #endif if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) make_scrambled_password_323(crypted_pw, argv[1]); make_scrambled_password_323(crypted_pw, pw); else make_scrambled_password(crypted_pw, argv[1]); make_scrambled_password(crypted_pw, pw); } else crypted_pw[0]=0; /* No password */ Loading heap/hp_create.c +7 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, { HP_KEYDEF *keyinfo; DBUG_PRINT("info",("Initializing new table")); /* We have to store sometimes byte* del_link in records, so the record length should be at least sizeof(byte*) */ set_if_bigger(reclength, sizeof (byte*)); for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++) { bzero((char*) &keyinfo->block,sizeof(keyinfo->block)); Loading libmysqld/Makefile.am +8 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ -I$(top_srcdir)/sql -I$(top_srcdir)/regex \ -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \ $(openssl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a Loading @@ -35,6 +35,7 @@ SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ my_time.c sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc noinst_HEADERS = embedded_priv.h emb_qcache.h Loading @@ -59,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) libmysqld_a_SOURCES= # automake misses these Loading Loading @@ -123,12 +124,16 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \ done; \ for f in $(sqlexamplessources); do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../sql/examples/$$f $(srcdir)/$$f; \ done; \ rm -f $(srcdir)/client_settings.h; \ @LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h; clean-local: rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \ rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \ $(top_srcdir)/linked_libmysqld_sources; \ rm -f client_settings.h Loading myisam/mi_packrec.c +41 −25 Original line number Diff line number Diff line Loading @@ -42,8 +42,9 @@ { bits-=(bit+1); break; } \ pos+= *pos #define OFFSET_TABLE_SIZE 512 static void read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, uint16 **decode_table,byte **intervall_buff, uint16 *tmp_buff); static void make_quick_table(uint16 *to_table,uint16 *decode_table, Loading @@ -53,7 +54,7 @@ static void fill_quick_table(uint16 *table,uint bits, uint max_bits, uint value); static uint copy_decode_table(uint16 *to_pos,uint offset, uint16 *decode_table); static uint find_longest_bitstream(uint16 *table); static uint find_longest_bitstream(uint16 *table, uint16 *end); static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field, MI_BIT_BUFF *buff, uchar *to, Loading Loading @@ -146,12 +147,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { if (!my_errno) my_errno=HA_ERR_END_OF_FILE; DBUG_RETURN(1); goto err0; } if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4)) { my_errno=HA_ERR_WRONG_IN_RECORD; DBUG_RETURN(1); goto err0; } share->pack.header_length= uint4korr(header+4); share->min_pack_length=(uint) uint4korr(header+8); Loading @@ -173,20 +174,20 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ intervall_length*sizeof(byte)), MYF(MY_WME)))) DBUG_RETURN(1); goto err0; intervall_buff=(byte*) (share->decode_trees+trees); length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); if (!(share->decode_tables=(uint16*) my_malloc((length+512)*sizeof(uint16)+ my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+ (uint) (share->pack.header_length+7), MYF(MY_WME | MY_ZEROFILL)))) { my_free((gptr) share->decode_trees,MYF(0)); DBUG_RETURN(1); goto err1; } tmp_buff=share->decode_tables+length; disk_cache=(byte*) (tmp_buff+512); disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE); if (my_read(file,disk_cache, (uint) (share->pack.header_length-sizeof(header)), Loading @@ -194,7 +195,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { my_free((gptr) share->decode_trees,MYF(0)); my_free((gptr) share->decode_tables,MYF(0)); DBUG_RETURN(1); goto err2; } huff_tree_bits=max_bit(trees ? trees-1 : 0); Loading @@ -213,8 +214,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) skip_to_next_byte(&bit_buff); decode_table=share->decode_tables; for (i=0 ; i < trees ; i++) read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, &intervall_buff,tmp_buff); if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, &intervall_buff,tmp_buff)) goto err3; decode_table=(uint16*) my_realloc((gptr) share->decode_tables, (uint) ((byte*) decode_table - (byte*) share->decode_tables), Loading @@ -224,8 +226,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) share->decode_tables=decode_table; for (i=0 ; i < trees ; i++) share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, diff, uint16*); diff, uint16*); } /* Fix record-ref-length for keys */ Loading @@ -242,19 +243,24 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) } if (bit_buff.error || bit_buff.pos < bit_buff.end) { /* info_length was wrong */ goto err3; DBUG_RETURN(0); err3: my_errno=HA_ERR_WRONG_IN_RECORD; my_free((gptr) share->decode_trees,MYF(0)); err2: my_free((gptr) share->decode_tables,MYF(0)); err1: my_free((gptr) share->decode_trees,MYF(0)); err0: DBUG_RETURN(1); } DBUG_RETURN(0); } /* Read on huff-code-table from datafile */ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, uint16 **decode_table, byte **intervall_buff, uint16 *tmp_buff) { Loading Loading @@ -297,7 +303,9 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, decode_tree->intervalls= *intervall_buff; if (! intervall_length) { table_bits=find_longest_bitstream(tmp_buff); table_bits=find_longest_bitstream(tmp_buff, tmp_buff+OFFSET_TABLE_SIZE); if (table_bits == (uint) ~0) return 1; if (table_bits > myisam_quick_table_bits) table_bits=myisam_quick_table_bits; next_free_offset= (1 << table_bits); Loading @@ -315,7 +323,7 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, bit_buff->pos+=intervall_length; bit_buff->bits=0; } return; return 0; } Loading Loading @@ -390,15 +398,23 @@ static uint copy_decode_table(uint16 *to_pos, uint offset, } static uint find_longest_bitstream(uint16 *table) static uint find_longest_bitstream(uint16 *table, uint16 *end) { uint length=1,length2; if (!(*table & IS_CHAR)) length=find_longest_bitstream(table+ *table)+1; { uint16 *next= table + *table; if (next > end || next == table) return ~0; length=find_longest_bitstream(next, end)+1; } table++; if (!(*table & IS_CHAR)) { length2=find_longest_bitstream(table+ *table)+1; uint16 *next= table + *table; if (next > end || next == table) return ~0; length2=find_longest_bitstream(table+ *table, end)+1; length=max(length,length2); } return length; Loading Loading
.bzrignore +3 −0 Original line number Diff line number Diff line Loading @@ -940,3 +940,6 @@ ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid ndb/tools/ndb_restore ac_available_languages_fragment libmysqld/ha_archive.cc libmysqld/ha_example.cc libmysqld/ha_tina.cc
client/mysqladmin.cc +9 −2 Original line number Diff line number Diff line Loading @@ -825,10 +825,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } if (argv[1][0]) { char *pw= argv[1]; #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') printf("Warning: single quotes were not trimmed from the password by" " your command\nline client, as you might have expected.\n"); #endif if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) make_scrambled_password_323(crypted_pw, argv[1]); make_scrambled_password_323(crypted_pw, pw); else make_scrambled_password(crypted_pw, argv[1]); make_scrambled_password(crypted_pw, pw); } else crypted_pw[0]=0; /* No password */ Loading
heap/hp_create.c +7 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, { HP_KEYDEF *keyinfo; DBUG_PRINT("info",("Initializing new table")); /* We have to store sometimes byte* del_link in records, so the record length should be at least sizeof(byte*) */ set_if_bigger(reclength, sizeof (byte*)); for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++) { bzero((char*) &keyinfo->block,sizeof(keyinfo->block)); Loading
libmysqld/Makefile.am +8 −3 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ -I$(top_srcdir)/sql -I$(top_srcdir)/regex \ -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \ $(openssl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a Loading @@ -35,6 +35,7 @@ SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ my_time.c sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc noinst_HEADERS = embedded_priv.h emb_qcache.h Loading @@ -59,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) libmysqld_a_SOURCES= # automake misses these Loading Loading @@ -123,12 +124,16 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \ done; \ for f in $(sqlexamplessources); do \ rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../sql/examples/$$f $(srcdir)/$$f; \ done; \ rm -f $(srcdir)/client_settings.h; \ @LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h; clean-local: rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \ rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \ $(top_srcdir)/linked_libmysqld_sources; \ rm -f client_settings.h Loading
myisam/mi_packrec.c +41 −25 Original line number Diff line number Diff line Loading @@ -42,8 +42,9 @@ { bits-=(bit+1); break; } \ pos+= *pos #define OFFSET_TABLE_SIZE 512 static void read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, uint16 **decode_table,byte **intervall_buff, uint16 *tmp_buff); static void make_quick_table(uint16 *to_table,uint16 *decode_table, Loading @@ -53,7 +54,7 @@ static void fill_quick_table(uint16 *table,uint bits, uint max_bits, uint value); static uint copy_decode_table(uint16 *to_pos,uint offset, uint16 *decode_table); static uint find_longest_bitstream(uint16 *table); static uint find_longest_bitstream(uint16 *table, uint16 *end); static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field, MI_BIT_BUFF *buff, uchar *to, Loading Loading @@ -146,12 +147,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { if (!my_errno) my_errno=HA_ERR_END_OF_FILE; DBUG_RETURN(1); goto err0; } if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4)) { my_errno=HA_ERR_WRONG_IN_RECORD; DBUG_RETURN(1); goto err0; } share->pack.header_length= uint4korr(header+4); share->min_pack_length=(uint) uint4korr(header+8); Loading @@ -173,20 +174,20 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ intervall_length*sizeof(byte)), MYF(MY_WME)))) DBUG_RETURN(1); goto err0; intervall_buff=(byte*) (share->decode_trees+trees); length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); if (!(share->decode_tables=(uint16*) my_malloc((length+512)*sizeof(uint16)+ my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+ (uint) (share->pack.header_length+7), MYF(MY_WME | MY_ZEROFILL)))) { my_free((gptr) share->decode_trees,MYF(0)); DBUG_RETURN(1); goto err1; } tmp_buff=share->decode_tables+length; disk_cache=(byte*) (tmp_buff+512); disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE); if (my_read(file,disk_cache, (uint) (share->pack.header_length-sizeof(header)), Loading @@ -194,7 +195,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { my_free((gptr) share->decode_trees,MYF(0)); my_free((gptr) share->decode_tables,MYF(0)); DBUG_RETURN(1); goto err2; } huff_tree_bits=max_bit(trees ? trees-1 : 0); Loading @@ -213,8 +214,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) skip_to_next_byte(&bit_buff); decode_table=share->decode_tables; for (i=0 ; i < trees ; i++) read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, &intervall_buff,tmp_buff); if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, &intervall_buff,tmp_buff)) goto err3; decode_table=(uint16*) my_realloc((gptr) share->decode_tables, (uint) ((byte*) decode_table - (byte*) share->decode_tables), Loading @@ -224,8 +226,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) share->decode_tables=decode_table; for (i=0 ; i < trees ; i++) share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, diff, uint16*); diff, uint16*); } /* Fix record-ref-length for keys */ Loading @@ -242,19 +243,24 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) } if (bit_buff.error || bit_buff.pos < bit_buff.end) { /* info_length was wrong */ goto err3; DBUG_RETURN(0); err3: my_errno=HA_ERR_WRONG_IN_RECORD; my_free((gptr) share->decode_trees,MYF(0)); err2: my_free((gptr) share->decode_tables,MYF(0)); err1: my_free((gptr) share->decode_trees,MYF(0)); err0: DBUG_RETURN(1); } DBUG_RETURN(0); } /* Read on huff-code-table from datafile */ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, uint16 **decode_table, byte **intervall_buff, uint16 *tmp_buff) { Loading Loading @@ -297,7 +303,9 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, decode_tree->intervalls= *intervall_buff; if (! intervall_length) { table_bits=find_longest_bitstream(tmp_buff); table_bits=find_longest_bitstream(tmp_buff, tmp_buff+OFFSET_TABLE_SIZE); if (table_bits == (uint) ~0) return 1; if (table_bits > myisam_quick_table_bits) table_bits=myisam_quick_table_bits; next_free_offset= (1 << table_bits); Loading @@ -315,7 +323,7 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, bit_buff->pos+=intervall_length; bit_buff->bits=0; } return; return 0; } Loading Loading @@ -390,15 +398,23 @@ static uint copy_decode_table(uint16 *to_pos, uint offset, } static uint find_longest_bitstream(uint16 *table) static uint find_longest_bitstream(uint16 *table, uint16 *end) { uint length=1,length2; if (!(*table & IS_CHAR)) length=find_longest_bitstream(table+ *table)+1; { uint16 *next= table + *table; if (next > end || next == table) return ~0; length=find_longest_bitstream(next, end)+1; } table++; if (!(*table & IS_CHAR)) { length2=find_longest_bitstream(table+ *table)+1; uint16 *next= table + *table; if (next > end || next == table) return ~0; length2=find_longest_bitstream(table+ *table, end)+1; length=max(length,length2); } return length; Loading