Below is the list of changes that have just been committed into a local
5.0 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1810 05/03/15 16:21:08 monty@stripped +5 -0
Merge with global tree
sql/sql_select.cc
1.295 05/03/15 16:21:04 monty@stripped +0 -2
Merge with global tree
sql/sql_parse.cc
1.419 05/03/15 16:09:06 monty@stripped +0 -0
Auto merged
sql/sp_head.cc
1.122 05/03/15 16:09:06 monty@stripped +0 -0
Auto merged
sql/mysqld.cc
1.437 05/03/15 16:09:06 monty@stripped +0 -0
Auto merged
sql/mysql_priv.h
1.276 05/03/15 16:09:06 monty@stripped +0 -0
Auto merged
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: monty
# Host: narttu.mysql.com
# Root: /home/my/mysql-5.0/RESYNC
--- 1.275/sql/mysql_priv.h 2005-03-14 15:47:37 +02:00
+++ 1.276/sql/mysql_priv.h 2005-03-15 16:09:06 +02:00
@@ -457,7 +457,7 @@
bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table);
bool check_merge_table_access(THD *thd, char *db,
TABLE_LIST *table_list);
-bool check_some_routine_access(THD *thd, char *db, char *name);
+bool check_some_routine_access(THD *thd, const char *db, const char *name);
bool multi_update_precheck(THD *thd, TABLE_LIST *tables);
bool multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count);
bool mysql_multi_update_prepare(THD *thd);
--- 1.436/sql/mysqld.cc 2005-03-08 16:31:57 +02:00
+++ 1.437/sql/mysqld.cc 2005-03-15 16:09:06 +02:00
@@ -366,7 +366,7 @@
char mysql_real_data_home[FN_REFLEN],
language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN],
*mysqld_user,*mysqld_chroot, *opt_init_file,
- *opt_init_connect, *opt_init_slave,
+ *opt_init_connect, *opt_init_slave, *opt_tc_log_file,
def_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
const char *opt_date_time_formats[3];
@@ -457,7 +457,7 @@
static int cleanup_done;
static ulong opt_specialflag, opt_myisam_block_size;
static char *opt_logname, *opt_update_logname, *opt_binlog_index_name;
-static char *opt_slow_logname, *opt_tc_log_file, *opt_tc_heuristic_recover;
+static char *opt_slow_logname, *opt_tc_heuristic_recover;
static char *mysql_home_ptr, *pidfile_name_ptr;
static char **defaults_argv;
static char *opt_bin_logname;
@@ -1462,7 +1462,8 @@
errcode ? ER(errcode) : ""));
if (lock)
(void) pthread_mutex_lock(&LOCK_thread_count);
- if ((vio=thd->net.vio) != 0)
+ thd->killed= THD::KILL_CONNECTION;
+ if ((vio= thd->net.vio) != 0)
{
if (errcode)
net_send_error(thd, errcode, ER(errcode)); /* purecov: inspected */
@@ -2799,6 +2800,11 @@
unireg_abort(1);
}
+ if (ha_recover(0))
+ {
+ unireg_abort(1);
+ }
+
if (opt_bin_log && mysql_bin_log.open(opt_bin_logname, LOG_BIN, 0,
WRITE_CACHE, 0, max_binlog_size, 0))
unireg_abort(1);
@@ -3147,10 +3153,10 @@
create_shutdown_thread();
create_maintenance_thread();
- sql_print_information(ER(ER_READY),my_progname,server_version,
- ((unix_sock == INVALID_SOCKET) ? (char*) ""
+ sql_print_information(ER(ER_STARTUP),my_progname,server_version,
+ ((unix_sock == INVALID_SOCKET) ? (char*) ""
: mysqld_unix_port),
- mysqld_port,
+ mysqld_port,
MYSQL_COMPILATION_COMMENT);
#if defined(__NT__) || defined(HAVE_SMEM)
@@ -4210,6 +4216,7 @@
OPT_INNODB_STATUS_FILE,
OPT_INNODB_MAX_DIRTY_PAGES_PCT,
OPT_INNODB_TABLE_LOCKS,
+ OPT_INNODB_SUPPORT_XA,
OPT_INNODB_OPEN_FILES,
OPT_INNODB_AUTOEXTEND_INCREMENT,
OPT_INNODB_SYNC_SPIN_LOOPS,
@@ -4512,6 +4519,11 @@
"Enable InnoDB locking in LOCK TABLES",
(gptr*) &global_system_variables.innodb_table_locks,
(gptr*) &global_system_variables.innodb_table_locks,
+ 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
+ {"innodb_support_xa", OPT_INNODB_SUPPORT_XA,
+ "Enable InnoDB support for the XA two-phase commit",
+ (gptr*) &global_system_variables.innodb_support_xa,
+ (gptr*) &global_system_variables.innodb_support_xa,
0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},
#endif /* End HAVE_INNOBASE_DB */
{"isam", OPT_ISAM, "Enable ISAM (if this version of MySQL supports it). \
--- 1.418/sql/sql_parse.cc 2005-03-15 01:14:55 +02:00
+++ 1.419/sql/sql_parse.cc 2005-03-15 16:09:06 +02:00
@@ -4760,7 +4760,7 @@
1 error
*/
-bool check_some_routine_access(THD *thd, char *db, char *name)
+bool check_some_routine_access(THD *thd, const char *db, const char *name)
{
ulong save_priv;
if (thd->master_access & SHOW_PROC_ACLS)
@@ -4768,12 +4768,7 @@
if (!check_access(thd, SHOW_PROC_ACLS, db, &save_priv, 0, 1) ||
(save_priv & SHOW_PROC_ACLS))
return FALSE;
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (grant_option)
- return check_routine_level_acl(thd, db, name);
-#endif
-
- return FALSE;
+ return check_routine_level_acl(thd, db, name);
}
--- 1.294/sql/sql_select.cc 2005-03-04 10:48:31 +02:00
+++ 1.295/sql/sql_select.cc 2005-03-15 16:21:04 +02:00
@@ -8361,6 +8361,117 @@
}
+/****************************************************************************/
+
+/*
+ Create a reduced TABLE object with properly set up Field list from a
+ list of field definitions.
+
+ SYNOPSIS
+ create_virtual_tmp_table()
+ thd connection handle
+ field_list list of column definitions
+
+ DESCRIPTION
+ The created table doesn't have a table handler assotiated with
+ it, has no keys, no group/distinct, no copy_funcs array.
+ The sole purpose of this TABLE object is to use the power of Field
+ class to read/write data to/from table->record[0]. Then one can store
+ the record in any container (RB tree, hash, etc).
+ The table is created in THD mem_root, so are the table's fields.
+ Consequently, if you don't BLOB fields, you don't need to free it.
+
+ RETURN
+ 0 if out of memory, TABLE object in case of success
+*/
+
+TABLE *create_virtual_tmp_table(THD *thd, List<create_field> &field_list)
+{
+ uint field_count= field_list.elements;
+ Field **field;
+ create_field *cdef; /* column definition */
+ uint record_length= 0;
+ uint null_count= 0; /* number of columns which may be null */
+ uint null_pack_length; /* NULL representation array length */
+ TABLE_SHARE *s;
+ /* Create the table and list of all fields */
+ TABLE *table= (TABLE*) thd->calloc(sizeof(*table));
+ field= (Field**) thd->alloc((field_count + 1) * sizeof(Field*));
+ if (!table || !field)
+ return 0;
+
+ table->field= field;
+ table->s= s= &table->share_not_to_be_used;
+ s->fields= field_count;
+
+ /* Create all fields and calculate the total length of record */
+ List_iterator_fast<create_field> it(field_list);
+ while ((cdef= it++))
+ {
+ *field= make_field(0, cdef->length,
+ (uchar*) (f_maybe_null(cdef->pack_flag) ? "" : 0),
+ f_maybe_null(cdef->pack_flag) ? 1 : 0,
+ cdef->pack_flag, cdef->sql_type, cdef->charset,
+ cdef->geom_type, cdef->unireg_check,
+ cdef->interval, cdef->field_name, table);
+ if (!*field)
+ goto error;
+ record_length+= (**field).pack_length();
+ if (! ((**field).flags & NOT_NULL_FLAG))
+ ++null_count;
+ ++field;
+ }
+ *field= NULL; /* mark the end of the list */
+
+ null_pack_length= (null_count + 7)/8;
+ s->reclength= record_length + null_pack_length;
+ s->rec_buff_length= ALIGN_SIZE(s->reclength + 1);
+ table->record[0]= (byte*) thd->alloc(s->rec_buff_length);
+ if (!table->record[0])
+ goto error;
+
+ if (null_pack_length)
+ {
+ table->null_flags= (uchar*) table->record[0];
+ s->null_fields= null_count;
+ s->null_bytes= null_pack_length;
+ }
+
+ table->in_use= thd; /* field->reset() may access table->in_use */
+ {
+ /* Set up field pointers */
+ byte *null_pos= table->record[0];
+ byte *field_pos= null_pos + s->null_bytes;
+ uint null_bit= 1;
+
+ for (field= table->field; *field; ++field)
+ {
+ Field *cur_field= *field;
+ if ((cur_field->flags & NOT_NULL_FLAG))
+ cur_field->move_field((char*) field_pos);
+ else
+ {
+ cur_field->move_field((char*) field_pos, (uchar*) null_pos, null_bit);
+ null_bit<<= 1;
+ if (null_bit == (1 << 8))
+ {
+ ++null_pos;
+ null_bit= 1;
+ }
+ }
+ cur_field->reset();
+
+ field_pos+= cur_field->pack_length();
+ }
+ }
+ return table;
+error:
+ for (field= table->field; *field; ++field)
+ delete *field; /* just invokes field destructor */
+ return 0;
+}
+
+
static bool open_tmp_table(TABLE *table)
{
int error;
@@ -10423,7 +10534,7 @@
{
ref_key= tab->ref.key;
ref_key_parts= tab->ref.key_parts;
- if (tab->type == JT_REF_OR_NULL)
+ if (tab->type == JT_REF_OR_NULL || tab->type == JT_FT)
DBUG_RETURN(0);
}
else if (select && select->quick) // Range found by opt_range
@@ -12899,7 +13010,21 @@
extra.append(')');
}
else if (tab->select->cond)
- extra.append("; Using where");
+ {
+ const COND *pushed_cond= tab->table->file->pushed_cond;
+
+ if (thd->variables.engine_condition_pushdown && pushed_cond)
+ {
+ extra.append("; Using where with pushed condition");
+ if (thd->lex->describe & DESCRIBE_EXTENDED)
+ {
+ extra.append(": ");
+ ((COND *)pushed_cond)->print(&extra);
+ }
+ }
+ else
+ extra.append("; Using where");
+ }
}
if (key_read)
{
--- 1.121/sql/sp_head.cc 2005-03-08 20:53:00 +02:00
+++ 1.122/sql/sp_head.cc 2005-03-15 16:09:06 +02:00
@@ -1016,23 +1016,31 @@
}
-bool check_show_routine_acceess(THD *thd, sp_head *sp, bool *full_access)
+/*
+ Check if a user has access right to a routine
+
+ SYNOPSIS
+ check_show_routine_access()
+ thd Thread handler
+ sp SP
+ full_access Set to 1 if the user has SELECT right to the
+ 'mysql.proc' able or is the owner of the routine
+ RETURN
+ 0 ok
+ 1 error
+*/
+
+bool check_show_routine_access(THD *thd, sp_head *sp, bool *full_access)
{
TABLE_LIST tables;
bzero((char*) &tables,sizeof(tables));
tables.db= (char*) "mysql";
tables.table_name= tables.alias= (char*) "proc";
- *full_access= !check_table_access(thd, SELECT_ACL, &tables, 1);
- if (!(*full_access))
- *full_access= (!strcmp(sp->m_definer_user.str, thd->priv_user) &&
- !strcmp(sp->m_definer_host.str, thd->priv_host));
- if (!(*full_access))
- {
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- return check_some_routine_access(thd, (char * )sp->m_db.str,
- (char * ) sp->m_name.str);
-#endif
- }
+ *full_access= (!check_table_access(thd, SELECT_ACL, &tables, 1) ||
+ (!strcmp(sp->m_definer_user.str, thd->priv_user) &&
+ !strcmp(sp->m_definer_host.str, thd->priv_host)));
+ if (!*full_access)
+ return check_some_routine_access(thd, sp->m_db.str, sp->m_name.str);
return 0;
}
@@ -1056,7 +1064,7 @@
LINT_INIT(sql_mode_str);
LINT_INIT(sql_mode_len);
- if (check_show_routine_acceess(thd, this, &full_access))
+ if (check_show_routine_access(thd, this, &full_access))
return 1;
old_sql_mode= thd->variables.sql_mode;
@@ -1129,7 +1137,7 @@
LINT_INIT(sql_mode_str);
LINT_INIT(sql_mode_len);
- if (check_show_routine_acceess(thd, this, &full_access))
+ if (check_show_routine_access(thd, this, &full_access))
return 1;
old_sql_mode= thd->variables.sql_mode;
| Thread |
|---|
| • bk commit into 5.0 tree (monty:1.1810) | monty | 15 Mar |