Commit b77fce84 authored by unknown's avatar unknown

Added missing root user to mysql.user on windows. (Bug #4242)

Set default max_allowed_packet to be able to read help tables even if an my.cnf file with this option is present. (Bug #3938)
Don't use default arguments for ha_rnd_init()
Simple code cleanups since last pull



scripts/fill_func_tables.sh:
  Change mode to -rw-rw-r--
scripts/make_win_src_distribution.sh:
  Safer remove of SCCS directories
scripts/mysql_create_system_tables.sh:
  Added missing root user to mysql.user on windows. (Bug #4242)
scripts/mysql_install_db.sh:
  Set default max_allowed_packet to be able to read help tables even if an my.cnf file with this option is present. (Bug #3938)
sql/filesort.cc:
  Don't use default arguments for ha_rnd_init()
sql/ha_berkeley.cc:
  Better to use #ifdef than // to disable code
  Removed not needed setting of active_index (It's set in index_end)
sql/ha_berkeley.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_heap.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_innodb.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_isam.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_isammrg.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_myisam.cc:
  Fixed wrong previous patch (New code used 'and' between two conditions when it should be 'or' as in original code)
sql/ha_myisam.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_myisammrg.h:
  Don't use default arguments for ha_rnd_init()
sql/ha_ndbcluster.h:
  Don't use default arguments for ha_rnd_init()
sql/handler.cc:
  Code cleanup
sql/handler.h:
  Keep bool variables together (better alignment)
sql/records.cc:
  Don't use default arguments for ha_rnd_init()
sql/sql_select.cc:
  Don't use default arguments for ha_rnd_init()
parent fdc90d2e
File mode changed from 100755 to 100644
......@@ -308,7 +308,6 @@ done
./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new
mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp
unix_to_dos $BASE/README
mv $BASE/README $BASE/README.txt
......@@ -318,7 +317,7 @@ mv $BASE/README $BASE/README.txt
if [ -d $BASE/SSL/SCCS ]
then
find $BASE -type d -name SCCS | xargs rm -r -f
find $BASE/ -type d -name SCCS -printf " \"%p\"" | xargs rm -r -f
fi
#
......
......@@ -159,7 +159,8 @@ then
INSERT INTO user (host,user) values ('$hostname','');
INSERT INTO user (host,user) values ('localhost','');"
else
i_u="INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);"
i_u="$i_u
INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);"
fi
fi
fi
......
......@@ -213,7 +213,7 @@ then
fi
mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \
--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \
--skip-bdb $args"
--skip-bdb $args --max_allowed_packet=8M"
if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \
| eval "$mysqld_install_cmd_line"
then
......
......@@ -373,7 +373,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select,
if (sort_form->key_read) // QQ Can be removed after the reset
file->extra(HA_EXTRA_KEYREAD); // QQ is removed
next_pos=(byte*) 0; /* Find records in sequence */
file->ha_rnd_init();
file->ha_rnd_init(1);
file->extra_opt(HA_EXTRA_CACHE,
current_thd->variables.read_buff_size);
}
......
......@@ -1583,14 +1583,18 @@ int ha_berkeley::index_last(byte * buf)
int ha_berkeley::rnd_init(bool scan)
{
DBUG_ENTER("rnd_init");
//DBUG_ASSERT(active_index==MAX_KEY);
#ifdef NOT_YET
DBUG_ASSERT(active_index == MAX_KEY);
#endif
current_row.flags=DB_DBT_REALLOC;
DBUG_RETURN(index_init(primary_key));
}
int ha_berkeley::rnd_end()
{
active_index= MAX_KEY;
#ifdef NOT_YET
DBUG_ASSERT(active_index == MAX_KEY);
#endif
return index_end();
}
......
......@@ -129,7 +129,7 @@ class ha_berkeley: public handler
int index_prev(byte * buf);
int index_first(byte * buf);
int index_last(byte * buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_end();
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
......
......@@ -72,7 +72,7 @@ class ha_heap: public handler
int index_prev(byte * buf);
int index_first(byte * buf);
int index_last(byte * buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
void position(const byte *record);
......
......@@ -134,7 +134,7 @@ class ha_innobase: public handler
int index_first(byte * buf);
int index_last(byte * buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_end();
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
......
......@@ -63,7 +63,7 @@ class ha_isam: public handler
int index_prev(byte * buf);
int index_first(byte * buf);
int index_last(byte * buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
void position(const byte *record);
......
......@@ -53,7 +53,7 @@ class ha_isammrg: public handler
int index_prev(byte * buf);
int index_first(byte * buf);
int index_last(byte * buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
void position(const byte *record);
......
......@@ -1004,8 +1004,10 @@ bool ha_myisam::check_and_repair(THD *thd)
{
int error=0;
int marked_crashed;
char *old_query;
uint old_query_length;
HA_CHECK_OPT check_opt;
DBUG_ENTER("ha_myisam::auto_check_and_repair");
DBUG_ENTER("ha_myisam::check_and_repair");
check_opt.init();
check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
......@@ -1013,15 +1015,15 @@ bool ha_myisam::check_and_repair(THD *thd)
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK;
sql_print_error("Warning: Checking table: '%s'",table->path);
if ((marked_crashed=mi_is_crashed(file)))
{
char *old_query= thd->query;
uint old_query_length= thd->query_length;
old_query= thd->query;
old_query_length= thd->query_length;
pthread_mutex_lock(&LOCK_thread_count);
thd->query= table->real_name;
thd->query_length= strlen(table->real_name);
pthread_mutex_unlock(&LOCK_thread_count);
if (check(thd, &check_opt))
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
sql_print_error("Warning: Recovering table: '%s'",table->path);
check_opt.flags=
......@@ -1036,7 +1038,6 @@ bool ha_myisam::check_and_repair(THD *thd)
thd->query= old_query;
thd->query_length= old_query_length;
pthread_mutex_unlock(&LOCK_thread_count);
}
DBUG_RETURN(error);
}
......
......@@ -92,7 +92,7 @@ class ha_myisam: public handler
FT_INFO *ft_init_ext(uint flags, uint inx,const byte *key, uint keylen)
{ return ft_init_search(flags,file,inx,(byte*) key,keylen, table->record[0]); }
int ft_read(byte *buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
int restart_rnd_next(byte *buf, byte *pos);
......
......@@ -65,7 +65,7 @@ class ha_myisammrg: public handler
int index_first(byte * buf);
int index_last(byte * buf);
int index_next_same(byte *buf, const byte *key, uint keylen);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_next(byte *buf);
int rnd_pos(byte * buf, byte *pos);
void position(const byte *record);
......
......@@ -73,7 +73,7 @@ class ha_ndbcluster: public handler
int index_prev(byte *buf);
int index_first(byte *buf);
int index_last(byte *buf);
int rnd_init(bool scan=1);
int rnd_init(bool scan);
int rnd_end();
int rnd_next(byte *buf);
int rnd_pos(byte *buf, byte *pos);
......
......@@ -222,9 +222,7 @@ bool ha_caching_allowed(THD* thd, char* table_key,
{
#ifdef HAVE_INNOBASE_DB
if (cache_type == HA_CACHE_TBL_ASKTRANSACT)
return innobase_query_caching_of_table_permitted(thd, table_key,
key_length);
else
return innobase_query_caching_of_table_permitted(thd, table_key, key_length);
#endif
return 1;
}
......
......@@ -271,8 +271,8 @@ class handler :public Sql_alloc
uint block_size; /* index block size */
uint raid_type,raid_chunks;
FT_INFO *ft_handler;
bool auto_increment_column_changed;
enum {NONE=0, INDEX, RND} inited;
bool auto_increment_column_changed;
bool implicit_emptied; /* Can be !=0 only if HEAP */
......@@ -316,7 +316,7 @@ class handler :public Sql_alloc
inited=NONE;
return index_end();
}
int ha_rnd_init(bool scan=1)
int ha_rnd_init(bool scan)
{
DBUG_ASSERT(inited==NONE || (inited==RND && scan));
inited=RND;
......
......@@ -117,7 +117,7 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
{
DBUG_PRINT("info",("using rr_sequential"));
info->read_record=rr_sequential;
table->file->ha_rnd_init();
table->file->ha_rnd_init(1);
/* We can use record cache if we don't update dynamic length tables */
if (!table->no_cache &&
(use_record_cache > 0 ||
......
......@@ -5552,7 +5552,7 @@ bool create_myisam_from_heap(THD *thd, TABLE *table, TMP_TABLE_PARAM *param,
if (table->file->indexes_are_disabled())
new_table.file->disable_indexes(HA_KEY_SWITCH_ALL);
table->file->ha_index_or_rnd_end();
table->file->ha_rnd_init();
table->file->ha_rnd_init(1);
if (table->no_rows)
{
new_table.file->extra(HA_EXTRA_NO_ROWS);
......@@ -7504,7 +7504,7 @@ static int remove_dup_with_compare(THD *thd, TABLE *table, Field **first_field,
org_record=(char*) (record=table->record[0])+offset;
new_record=(char*) table->record[1]+offset;
file->ha_rnd_init();
file->ha_rnd_init(1);
error=file->rnd_next(record);
for (;;)
{
......@@ -7616,7 +7616,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table,
(*field_length++)= (*ptr)->pack_length();
}
file->ha_rnd_init();
file->ha_rnd_init(1);
key_pos=key_buffer;
for (;;)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment