mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb
This commit is contained in:
commit
286387d3a1
12 changed files with 47 additions and 28 deletions
|
@ -540,7 +540,6 @@ static void free_used_memory()
|
|||
mysql_server_end();
|
||||
if (ps_protocol)
|
||||
ps_free_reg();
|
||||
my_end(MY_CHECK_ERROR);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
@ -558,6 +557,7 @@ static void die(const char* fmt, ...)
|
|||
}
|
||||
va_end(args);
|
||||
free_used_memory();
|
||||
my_end(MY_CHECK_ERROR);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -570,6 +570,7 @@ static void abort_not_supported_test()
|
|||
if (!silent)
|
||||
printf("skipped\n");
|
||||
free_used_memory();
|
||||
my_end(MY_CHECK_ERROR);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
|
@ -668,6 +669,7 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname,
|
|||
{
|
||||
int error = 0;
|
||||
int res=dyn_string_cmp(ds, fname);
|
||||
DBUG_ENTER("check_result");
|
||||
|
||||
if (res && require_option)
|
||||
abort_not_supported_test();
|
||||
|
@ -687,7 +689,7 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname,
|
|||
}
|
||||
if (error)
|
||||
reject_dump(fname, ds->str, ds->length);
|
||||
return error;
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1842,7 +1844,10 @@ int read_line(char* buf, int size)
|
|||
cur_file--;
|
||||
lineno--;
|
||||
if (cur_file == file_stack)
|
||||
{
|
||||
DBUG_PRINT("info", ("end of file"));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -2012,7 +2017,6 @@ int read_query(struct st_query** q_ptr)
|
|||
q->query_buf= q->query= 0;
|
||||
if (read_line(read_query_buf, sizeof(read_query_buf)))
|
||||
{
|
||||
DBUG_PRINT("warning",("too long query"));
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_PRINT("info", ("query: %s", read_query_buf));
|
||||
|
@ -3367,8 +3371,6 @@ int main(int argc, char **argv)
|
|||
my_bool require_file=0, q_send_flag=0, abort_flag= 0;
|
||||
char save_file[FN_REFLEN];
|
||||
MY_INIT(argv[0]);
|
||||
{
|
||||
DBUG_ENTER("main");
|
||||
|
||||
/* Use all time until exit if no explicit 'start_timer' */
|
||||
timer_start= timer_now();
|
||||
|
@ -3395,6 +3397,8 @@ int main(int argc, char **argv)
|
|||
*block_ok = 1;
|
||||
init_dynamic_string(&ds_res, "", 0, 65536);
|
||||
parse_args(argc, argv);
|
||||
|
||||
DBUG_PRINT("info",("result_file: '%s'", result_file ? result_file : ""));
|
||||
if (mysql_server_init(embedded_server_arg_count,
|
||||
embedded_server_args,
|
||||
(char**) embedded_server_groups))
|
||||
|
@ -3660,9 +3664,9 @@ int main(int argc, char **argv)
|
|||
if (!got_end_timer)
|
||||
timer_output(); /* No end_timer cmd, end it */
|
||||
free_used_memory();
|
||||
my_end(MY_CHECK_ERROR);
|
||||
exit(error ? 1 : 0);
|
||||
return error ? 1 : 0; /* Keep compiler happy */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -622,7 +622,7 @@ qq
|
|||
*a *a*a *
|
||||
explain select * from t1 where v='a';
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref v v 13 const 7 Using where
|
||||
1 SIMPLE t1 ref v v 13 const # Using where
|
||||
drop table t1;
|
||||
create table t1 (a char(10), unique using btree (a)) engine=heap;
|
||||
insert into t1 values ('a');
|
||||
|
|
|
@ -1698,7 +1698,7 @@ t5 CREATE TABLE `t5` (
|
|||
`param03` double default NULL,
|
||||
`const04` varchar(3) NOT NULL default '',
|
||||
`param04` longtext,
|
||||
`const05` binary(3) NOT NULL default '',
|
||||
`const05` varbinary(3) NOT NULL default '',
|
||||
`param05` longblob,
|
||||
`const06` varchar(10) NOT NULL default '',
|
||||
`param06` longtext,
|
||||
|
@ -4707,7 +4707,7 @@ t5 CREATE TABLE `t5` (
|
|||
`param03` double default NULL,
|
||||
`const04` varchar(3) NOT NULL default '',
|
||||
`param04` longtext,
|
||||
`const05` varchar(3) NOT NULL default '',
|
||||
`const05` varbinary(3) NOT NULL default '',
|
||||
`param05` longblob,
|
||||
`const06` varchar(10) NOT NULL default '',
|
||||
`param06` longtext,
|
||||
|
|
|
@ -360,6 +360,8 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a '
|
|||
--error 1062
|
||||
alter table t1 add unique(v);
|
||||
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a' order by length(concat('*',v,'*',c,'*',t,'*'));
|
||||
# Number of rows is not constant for b-trees keys
|
||||
--replace_column 9 #
|
||||
explain select * from t1 where v='a';
|
||||
|
||||
drop table t1;
|
||||
|
|
|
@ -9,6 +9,7 @@ use test;
|
|||
|
||||
# create system tables as in mysql-3.20
|
||||
|
||||
--disable_warnings
|
||||
CREATE TABLE db (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
|
@ -23,10 +24,12 @@ CREATE TABLE db (
|
|||
KEY User (User)
|
||||
)
|
||||
type=ISAM;
|
||||
--enable-warnings
|
||||
|
||||
INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
|
||||
|
||||
--disable_warnings
|
||||
CREATE TABLE host (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
Db char(32) binary DEFAULT '' NOT NULL,
|
||||
|
@ -39,7 +42,9 @@ CREATE TABLE host (
|
|||
PRIMARY KEY Host (Host,Db)
|
||||
)
|
||||
type=ISAM;
|
||||
--enable-warnings
|
||||
|
||||
--disable_warnings
|
||||
CREATE TABLE user (
|
||||
Host char(60) binary DEFAULT '' NOT NULL,
|
||||
User char(16) binary DEFAULT '' NOT NULL,
|
||||
|
@ -56,6 +61,7 @@ CREATE TABLE user (
|
|||
PRIMARY KEY Host (Host,User)
|
||||
)
|
||||
type=ISAM;
|
||||
--enable-warnings
|
||||
|
||||
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
|
||||
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
|
||||
|
|
|
@ -85,7 +85,7 @@ int Buffer::reserve(uint position, uint len_arg)
|
|||
min(MAX_BUFFER_SIZE,
|
||||
max((uint) (buffer_size*1.5),
|
||||
position + len_arg)));
|
||||
if (buffer= NULL)
|
||||
if (buffer == NULL)
|
||||
goto err;
|
||||
buffer_size= (uint) (buffer_size*1.5);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ int Show_instances::do_command(struct st_net *net)
|
|||
Instance_map::Iterator iterator(instance_map);
|
||||
|
||||
instance_map->lock();
|
||||
while (instance= iterator.next())
|
||||
while ((instance= iterator.next()))
|
||||
{
|
||||
position= 0;
|
||||
store_to_string(&send_buff, instance->options.instance_name, &position);
|
||||
|
@ -117,7 +117,7 @@ Show_instance_status::Show_instance_status(Instance_map *instance_map_arg,
|
|||
Instance *instance;
|
||||
|
||||
/* we make a search here, since we don't want t store the name */
|
||||
if (instance= instance_map->find(name, len))
|
||||
if ((instance= instance_map->find(name, len)))
|
||||
{
|
||||
instance_name= instance->options.instance_name;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ Show_instance_options::Show_instance_options(Instance_map *instance_map_arg,
|
|||
Instance *instance;
|
||||
|
||||
/* we make a search here, since we don't want t store the name */
|
||||
if (instance= instance_map->find(name, len))
|
||||
if ((instance= instance_map->find(name, len)))
|
||||
{
|
||||
instance_name= instance->options.instance_name;
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ int Show_instance_options::do_command(struct st_net *net,
|
|||
}
|
||||
|
||||
/* loop through the options stored in DYNAMIC_ARRAY */
|
||||
for (int i= 0; i < instance->options.options_array.elements; i++)
|
||||
for (uint i= 0; i < instance->options.options_array.elements; i++)
|
||||
{
|
||||
char *tmp_option, *option_value;
|
||||
get_dynamic(&(instance->options.options_array), (gptr) &tmp_option, i);
|
||||
|
@ -355,7 +355,7 @@ Start_instance::Start_instance(Instance_map *instance_map_arg,
|
|||
:Command(instance_map_arg)
|
||||
{
|
||||
/* we make a search here, since we don't want t store the name */
|
||||
if (instance= instance_map->find(name, len))
|
||||
if ((instance= instance_map->find(name, len)))
|
||||
instance_name= instance->options.instance_name;
|
||||
}
|
||||
|
||||
|
@ -388,7 +388,7 @@ Stop_instance::Stop_instance(Instance_map *instance_map_arg,
|
|||
:Command(instance_map_arg)
|
||||
{
|
||||
/* we make a search here, since we don't want t store the name */
|
||||
if (instance= instance_map->find(name, len))
|
||||
if ((instance= instance_map->find(name, len)))
|
||||
instance_name= instance->options.instance_name;
|
||||
}
|
||||
|
||||
|
@ -406,7 +406,7 @@ int Stop_instance::execute(struct st_net *net, ulong connection_id)
|
|||
if (instance->options.is_guarded != NULL)
|
||||
instance_map->guardian->
|
||||
stop_guard(instance);
|
||||
if (err_code= instance->stop())
|
||||
if ((err_code= instance->stop()))
|
||||
return err_code;
|
||||
printf("instance was stopped\n");
|
||||
net_send_ok(net, connection_id);
|
||||
|
|
|
@ -110,7 +110,7 @@ int Guardian_thread::start()
|
|||
Instance_map::Iterator iterator(instance_map);
|
||||
|
||||
instance_map->lock();
|
||||
while (instance= iterator.next())
|
||||
while ((instance= iterator.next()))
|
||||
{
|
||||
if ((instance->options.is_guarded != NULL) && (instance->is_running()))
|
||||
if (guard(instance))
|
||||
|
|
|
@ -88,8 +88,8 @@ Instance::~Instance()
|
|||
|
||||
bool Instance::is_running()
|
||||
{
|
||||
uint port;
|
||||
const char *socket;
|
||||
uint port= 0;
|
||||
const char *socket= NULL;
|
||||
|
||||
if (options.mysqld_port)
|
||||
port= atoi(strchr(options.mysqld_port, '=') + 1);
|
||||
|
|
|
@ -203,9 +203,12 @@ int Instance_map::cleanup()
|
|||
while (i < hash.records)
|
||||
{
|
||||
instance= (Instance *) hash_element(&hash, i);
|
||||
instance->cleanup();
|
||||
if (instance->cleanup())
|
||||
return 1;
|
||||
i++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -250,7 +253,7 @@ Instance *Instance_map::Iterator::next()
|
|||
{
|
||||
if (current_instance < instance_map->hash.records)
|
||||
return (Instance *) hash_element(&instance_map->hash, current_instance++);
|
||||
else
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@ extern void free_groups(char **groups);
|
|||
|
||||
class Instance_map
|
||||
{
|
||||
friend class Iterator;
|
||||
public:
|
||||
/* Instance_map iterator */
|
||||
class Iterator
|
||||
|
@ -54,6 +53,7 @@ public:
|
|||
void go_to_first();
|
||||
Instance *next();
|
||||
};
|
||||
friend class Iterator;
|
||||
public:
|
||||
/* returns a pointer to the instance or NULL, if there is no such instance */
|
||||
Instance *find(const char *name, uint name_len);
|
||||
|
|
|
@ -2135,6 +2135,10 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
|
|||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
If we have information schema its always the first table and only
|
||||
the first table. Reset for other tables.
|
||||
*/
|
||||
with_i_schema= 0;
|
||||
}
|
||||
}
|
||||
|
@ -2838,7 +2842,7 @@ static int get_schema_views_record(THD *thd, struct st_table_list *tables,
|
|||
}
|
||||
|
||||
|
||||
void store_constarints(TABLE *table, const char*db, const char *tname,
|
||||
void store_constraints(TABLE *table, const char*db, const char *tname,
|
||||
const char *key_name, uint key_len,
|
||||
const char *con_type, uint con_len)
|
||||
{
|
||||
|
@ -2874,10 +2878,10 @@ static int get_schema_constarints_record(THD *thd, struct st_table_list *tables,
|
|||
continue;
|
||||
|
||||
if (i == primary_key && !strcmp(key_info->name, primary_key_name))
|
||||
store_constarints(table, base_name, file_name, key_info->name,
|
||||
store_constraints(table, base_name, file_name, key_info->name,
|
||||
strlen(key_info->name), "PRIMARY KEY", 11);
|
||||
else if (key_info->flags & HA_NOSAME)
|
||||
store_constarints(table, base_name, file_name, key_info->name,
|
||||
store_constraints(table, base_name, file_name, key_info->name,
|
||||
strlen(key_info->name), "UNIQUE", 6);
|
||||
}
|
||||
|
||||
|
@ -2886,7 +2890,7 @@ static int get_schema_constarints_record(THD *thd, struct st_table_list *tables,
|
|||
List_iterator_fast<FOREIGN_KEY_INFO> it(f_key_list);
|
||||
while ((f_key_info=it++))
|
||||
{
|
||||
store_constarints(table, base_name, file_name, f_key_info->forein_id->str,
|
||||
store_constraints(table, base_name, file_name, f_key_info->forein_id->str,
|
||||
strlen(f_key_info->forein_id->str), "FOREIGN KEY", 11);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue