Commit df69f93a authored by pem@mysql.com's avatar pem@mysql.com

Post-merge post-merge fix (new error codes for fparser).

parents ec921065 654bf99b
......@@ -386,6 +386,7 @@ libmysqld/opt_ft.cc
libmysqld/opt_range.cc
libmysqld/opt_sum.cc
libmysqld/pack.c
libmysqld/parse_file.cc
libmysqld/password.c
libmysqld/procedure.cc
libmysqld/protocol.cc
......
......@@ -161,6 +161,7 @@ tim@sand.box
tim@threads.polyesthetic.msg
tim@white.box
tim@work.mysql.com
timour@mysql.com
tom@basil-firewall.home.com
tomas@mc05.(none)
tonu@hundin.mysql.fi
......
......@@ -121,6 +121,13 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_ERRNO_EDOM 33
#define MY_ERRNO_ERANGE 34
/* Bits for get_date timeflag */
#define GETDATE_DATE_TIME 1
#define GETDATE_SHORT_DATE 2
#define GETDATE_HHMMSSTIME 4
#define GETDATE_GMT 8
#define GETDATE_FIXEDLENGTH 16
/* defines when allocating data */
#ifdef SAFEMALLOC
#define my_malloc(SZ,FLAG) _mymalloc((SZ), __FILE__, __LINE__, FLAG )
......
......@@ -349,4 +349,9 @@
#define ER_SP_VARCOND_AFTER_CURSHNDLR 1330
#define ER_SP_CURSOR_AFTER_HANDLER 1331
#define ER_SP_CASE_NOT_FOUND 1332
#define ER_ERROR_MESSAGES 333
#define ER_FPARSER_TOO_BIG_FILE 1333
#define ER_FPARSER_BAD_HEADER 1334
#define ER_FPARSER_EOF_IN_COMMENT 1335
#define ER_FPARSER_ERROR_IN_PARAMETER 1336
#define ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER 1337
#define ER_ERROR_MESSAGES 338
......@@ -58,7 +58,8 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
sql_update.cc sql_yacc.cc table.cc thr_malloc.cc time.cc \
unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \
spatial.cc gstream.cc sql_help.cc protocol_cursor.cc \
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc
sp_head.cc sp_pcontext.cc sp.cc sp_cache.cc sp_rcontext.cc \
parse_file.cc
libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources)
libmysqld_a_SOURCES=
......
......@@ -388,8 +388,8 @@ SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
email shipcode
test1@testdomain.com Z001
test2@testdomain.com Z001
test3@testdomain.com Z001
test2@testdomain.com R002
test3@testdomain.com Z001
SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
email
test1@testdomain.com
......
......@@ -183,12 +183,12 @@ insert into t2 values('BBB', 20, 1.0);
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2;
a1 a2 a1 a2
10 aaa AAA 10
10 NULL AAA 10
10 bbb AAA 10
20 zzz AAA 10
10 aaa BBB 20
10 NULL AAA 10
10 NULL BBB 20
10 bbb AAA 10
10 bbb BBB 20
20 zzz AAA 10
20 zzz BBB 20
select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9;
max(t1.a1) max(t2.a1)
......
This diff is collapsed.
......@@ -1393,8 +1393,8 @@ companynr companynr
41 40
explain select distinct t2.companynr,t4.companynr from t2,t4 where t2.companynr=t4.companynr+1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using temporary
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using where; Using index
1 SIMPLE t4 index NULL PRIMARY 1 NULL 12 Using index; Using temporary
1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where
select t2.fld1,t2.companynr,fld3,period from t3,t2 where t2.fld1 = 38208 and t2.fld1=t3.t2nr and period = 1008 or t2.fld1 = 38008 and t2.fld1 =t3.t2nr and period = 1008;
fld1 companynr fld3 period
038008 37 reporters 1008
......@@ -2314,8 +2314,8 @@ left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
1 SIMPLE t2 ALL NULL NULL NULL NULL 1
1 SIMPLE t4 ALL id4 NULL NULL NULL 1 Using where
1 SIMPLE t4 ALL id4 NULL NULL NULL 1
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 Using where
select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
id1 id2 id3 id4 id44
......
......@@ -1348,8 +1348,8 @@ a
explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a 5 NULL 4 Using where; Using index
2 DEPENDENT SUBQUERY t1 ref a a 5 func 1001 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using where; Using index
2 DEPENDENT SUBQUERY t3 index a a 5 NULL 3 Using index
2 DEPENDENT SUBQUERY t1 ref a a 10 func,test.t3.a 1000 Using where; Using index
Warnings:
Note 1003 select high_priority test.t2.a AS `a` from test.t2 where <in_optimizer>(test.t2.a,<exists>(select 1 AS `Not_used` from test.t1 join test.t3 where ((test.t1.b = test.t3.a) and (<cache>(test.t2.a) = test.t1.a))))
insert into t1 values (3,31);
......
This diff is collapsed.
......@@ -19,11 +19,20 @@
#include "mysys_priv.h"
#include <m_string.h>
/*
If flag & 1 Return date and time
If flag & 2 Return short date format YYMMDD
if flag & 4 Return time in HHMMDD format.
*/
/*
get date as string
SYNOPSIS
get_date()
to - string where date will be written
flag - format of date:
If flag & GETDATE_TIME Return date and time
If flag & GETDATE_SHORT_DATE Return short date format YYMMDD
If flag & GETDATE_HHMMSSTIME Return time in HHMMDD format.
If flag & GETDATE_GMT Date/time in GMT
If flag & GETDATE_FIXEDLENGTH Return fixed length date/time
date - for conversion
*/
void get_date(register my_string to, int flag, time_t date)
......@@ -36,27 +45,36 @@ void get_date(register my_string to, int flag, time_t date)
skr=date ? (time_t) date : time((time_t*) 0);
#if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT)
if (flag & GETDATE_GMT)
localtime_r(&skr,&tm_tmp);
else
gmtime_r(&skr,&tm_tmp);
start_time= &tm_tmp;
#else
start_time=localtime(&skr);
if (flag & GETDATE_GMT)
start_time= localtime(&skr);
else
gmtime(&skr,&tm_tmp);
#endif
if (flag & 2)
if (flag & GETDATE_SHORT_DATE)
sprintf(to,"%02d%02d%02d",
start_time->tm_year % 100,
start_time->tm_mon+1,
start_time->tm_mday);
else
sprintf(to,"%d-%02d-%02d",
sprintf(to, ((flag & GETDATE_FIXEDLENGTH) ?
"%4d-%02d-%02d" : "%d-%02d-%02d"),
start_time->tm_year+1900,
start_time->tm_mon+1,
start_time->tm_mday);
if (flag & 1)
sprintf(strend(to)," %2d:%02d:%02d",
if (flag & GETDATE_DATE_TIME)
sprintf(strend(to),
((flag & GETDATE_FIXEDLENGTH) ?
" %02d:%02d:%02d" : " %2d:%02d:%02d"),
start_time->tm_hour,
start_time->tm_min,
start_time->tm_sec);
else if (flag & 4)
else if (flag & GETDATE_HHMMSSTIME)
sprintf(strend(to),"%02d%02d%02d",
start_time->tm_hour,
start_time->tm_min,
......
......@@ -59,7 +59,8 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
stacktrace.h sql_sort.h sql_cache.h set_var.h \
spatial.h gstream.h client_settings.h \
examples/ha_example.h \
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h
sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
parse_file.h
mysqld_SOURCES = sql_lex.cc sql_handler.cc \
item.cc item_sum.cc item_buff.cc item_func.cc \
item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
......@@ -91,7 +92,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc \
gstream.cc spatial.cc sql_help.cc protocol_cursor.cc \
examples/ha_example.cc \
sp_head.cc sp_pcontext.cc sp_rcontext.cc sp.cc \
sp_cache.cc
sp_cache.cc parse_file.cc
gen_lex_hash_SOURCES = gen_lex_hash.cc
gen_lex_hash_LDADD = $(LDADD) $(CXXLDFLAGS)
......
......@@ -375,6 +375,7 @@ inline THD *_current_thd(void)
#include "sql_list.h"
#include "sql_map.h"
#include "handler.h"
#include "parse_file.h"
#include "table.h"
#include "field.h" /* Field definitions */
#include "protocol.h"
......@@ -787,6 +788,8 @@ extern "C" pthread_handler_decl(handle_manager, arg);
void print_where(COND *cond,const char *info);
void print_cached_tables(void);
void TEST_filesort(SORT_FIELD *sortorder,uint s_length);
void print_plan(JOIN* join, double read_time, double record_count,
uint idx, const char *info);
#endif
void mysql_print_status(THD *thd);
/* key.cc */
......@@ -854,6 +857,7 @@ extern char language[LIBLEN],reg_ext[FN_EXTLEN];
extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN];
extern double last_query_cost;
extern double log_10[32];
extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
......
......@@ -312,6 +312,7 @@ ulong expire_logs_days = 0;
ulong rpl_recovery_rank=0;
ulong my_bind_addr; /* the address we bind to */
volatile ulong cached_thread_count= 0;
double last_query_cost= -1; /* -1 denotes that no query was compiled yet */
double log_10[32]; /* 10 potences */
ulonglong log_10_int[20]=
......@@ -3775,7 +3776,9 @@ enum options_mysqld
OPT_DATE_FORMAT,
OPT_TIME_FORMAT,
OPT_DATETIME_FORMAT,
OPT_LOG_QUERIES_NOT_USING_INDEXES
OPT_LOG_QUERIES_NOT_USING_INDEXES,
OPT_PLAN_SEARCH_DEPTH,
OPT_HEURISTIC
};
......@@ -4400,6 +4403,11 @@ log and this option does nothing anymore.",
"Use stopwords from this file instead of built-in list.",
(gptr*) &ft_stopword_file, (gptr*) &ft_stopword_file, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"heuristic", OPT_HEURISTIC,
"Controls the heuristic(s) applied during query optimization to prune less-promising partial plans from the optimizer search space. Meaning: 0 - do not apply any heuristic, thus perform exhaustive search; 1 - prune plans based on rows and read time.",
(gptr*) &global_system_variables.heuristic,
(gptr*) &max_system_variables.heuristic,
0, GET_ULONG, OPT_ARG, 1, 0, 1, 0, 1, 0},
#ifdef HAVE_INNOBASE_DB
{"innodb_mirrored_log_groups", OPT_INNODB_MIRRORED_LOG_GROUPS,
"Number of identical copies of log groups we keep for the database. Currently this should be set to 1.",
......@@ -4640,6 +4648,11 @@ The minimum value for this variable is 4096.",
"If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
(gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
{"plan_search_depth", OPT_PLAN_SEARCH_DEPTH,
"Maximum depth of search performed by the query optimizer. Values larger than the number of relations in a query result in better query plans, but take longer to compile a query. Smaller values than the number of tables in a relation result in faster optimization, but may produce very bad query plans. If set to 0, the system will automatically pick a reasonable value; if set to MAX_TABLES+2, the optimizer will switch to the original find_best (used for testing/comparison).",
(gptr*) &global_system_variables.plan_search_depth,
(gptr*) &max_system_variables.plan_search_depth,
0, GET_ULONG, OPT_ARG, MAX_TABLES+1, 0, MAX_TABLES+2, 0, 1, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
(gptr*) &global_system_variables.preload_buff_size,
......@@ -4930,6 +4943,7 @@ struct show_var_st status_vars[]= {
SHOW_KEY_CACHE_LONG},
{"Key_writes", (char*) &dflt_key_cache_var.global_cache_write,
SHOW_KEY_CACHE_LONG},
{"Last_query_cost", (char*) &last_query_cost, SHOW_DOUBLE},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST},
{"Open_files", (char*) &my_file_opened, SHOW_LONG_CONST},
......
This diff is collapsed.
/* -*- C++ -*- */
/* Copyright (C) 2004 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef _PARSE_FILE_H_
#define _PARSE_FILE_H_
#define PARSE_FILE_TIMESTAMPLENGTH 19
typedef enum {
FILE_OPTIONS_STRING, /* String (LEX_STRING) */
FILE_OPTIONS_ESTRING, /* Escaped string (LEX_STRING) */
FILE_OPTIONS_ULONGLONG, /* ulonglong parapeter (ulonglong) */
FILE_OPTIONS_REV, /* Revision version number (ulonglong) */
FILE_OPTIONS_TIMESTAMP, /* timestamp (LEX_STRING have to be
allocated with length 20 (19+1) */
FILE_OPTIONS_STRLIST /* list of strings (List<char*>) */
} file_opt_type;
struct File_option
{
const LEX_STRING name; /* Name of the option */
int offset; /* offset to base address of value */
enum file_opt_type type; /* Option type */
};
class File_parser;
File_parser *sql_parse_prepare(const LEX_STRING *file_name,
MEM_ROOT *mem_root);
my_bool
sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
const LEX_STRING *type,
gptr base, File_option *parameters, uint versions);
class File_parser: public Sql_alloc
{
char *buff, *start, *end;
LEX_STRING file_type;
my_bool content_ok;
public:
File_parser() :buff(0), start(0), end(0), content_ok(0)
{ file_type.str= 0; file_type.length= 0; }
my_bool ok() { return content_ok; }
LEX_STRING *type() { return &file_type; }
my_bool parse(gptr base, MEM_ROOT *mem_root,
struct File_option *parameters, uint required);
friend File_parser *sql_parse_prepare(const LEX_STRING *file_name,
MEM_ROOT *mem_root,
bool bad_format_errors);
};
#endif /* _PARSE_FILE_H_ */
......@@ -160,6 +160,7 @@ sys_var_str sys_ft_boolean_syntax("ft_boolean_syntax",
sys_update_ftb_syntax,
sys_default_ftb_syntax,
ft_boolean_syntax);
sys_var_thd_ulong sys_heuristic("heuristic", &SV::heuristic);
sys_var_str sys_init_connect("init_connect", 0,
sys_update_init_connect,
sys_default_init_connect,0);
......@@ -262,6 +263,8 @@ sys_var_thd_ulong sys_net_retry_count("net_retry_count",
0, fix_net_retry_count);
sys_var_thd_bool sys_new_mode("new", &SV::new_mode);
sys_var_thd_bool sys_old_passwords("old_passwords", &SV::old_passwords);
sys_var_thd_ulong sys_plan_search_depth("plan_search_depth",
&SV::plan_search_depth);
sys_var_thd_ulong sys_preload_buff_size("preload_buffer_size",
&SV::preload_buff_size);
sys_var_thd_ulong sys_read_buff_size("read_buffer_size",
......@@ -488,6 +491,7 @@ sys_var *sys_variables[]=
&sys_ft_boolean_syntax,
&sys_foreign_key_checks,
&sys_group_concat_max_len,
&sys_heuristic,
&sys_identity,
&sys_init_connect,
&sys_init_slave,
......@@ -536,6 +540,7 @@ sys_var *sys_variables[]=
&sys_net_write_timeout,
&sys_new_mode,
&sys_old_passwords,
&sys_plan_search_depth,
&sys_preload_buff_size,
&sys_pseudo_thread_id,
&sys_query_alloc_block_size,
......@@ -812,6 +817,8 @@ struct show_var_st init_vars[]= {
{"version_compile_machine", (char*) MACHINE_TYPE, SHOW_CHAR},
{sys_os.name, (char*) &sys_os, SHOW_SYS},
{sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout, SHOW_SYS},
{sys_heuristic.name, (char*) &sys_heuristic, SHOW_SYS},
{sys_plan_search_depth.name,(char*) &sys_plan_search_depth, SHOW_SYS},
{NullS, NullS, SHOW_LONG}
};
......
......@@ -345,3 +345,8 @@ character-set=latin2
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -339,3 +339,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -347,3 +347,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -341,3 +341,8 @@ character-set=latin7
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -348,3 +348,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=greek
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=latin2
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=ujis
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=euckr
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -340,3 +340,8 @@ character-set=latin2
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -337,3 +337,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -340,3 +340,8 @@ character-set=latin2
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=koi8r
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
" '%-.64s'"
" '%-.64s'"
" '%-.64s'"
" '%-.64s' (: '%-.64s')"
" '%-.64s'"
......@@ -330,3 +330,8 @@ character-set=cp1250
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -344,3 +344,8 @@ character-set=latin2
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -338,3 +338,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -336,3 +336,8 @@ character-set=latin1
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
"Configuration file '%-.64s' is too big"
"Malformed file type header in file '%-.64s'"
"Unexpected end of file during parsing comment '%-.64s'"
"Error during parsing parameter '%-.64s' (line: '%-.64s')"
"Unexpected end of file during skipping unknown parameter '%-.64s'"
......@@ -341,3 +341,8 @@ character-set=koi8u
"Variable or condition declaration after cursor or handler declaration"
"Cursor declaration after handler declaration"
"Case not found for CASE statement"
" Ʀæ '%-.64s'"
"צ ̦ '%-.64s'"
"Ħ ˦ Ҧ '%-.64s'"
" ЦΦ '%-.64s' (: '%-.64s')"
"Ħ ˦ ¦ צ '%-.64s'"
......@@ -392,6 +392,8 @@ struct system_variables
ulong table_type;
ulong tmp_table_size;
ulong tx_isolation;
ulong heuristic;
ulong plan_search_depth;
/* Determines which non-standard SQL behaviour should be enabled */
ulong sql_mode;
ulong default_week_format;
......
This diff is collapsed.
......@@ -116,6 +116,7 @@ typedef struct st_join_table {
typedef struct st_position /* Used in find_best */
{
double records_read;
double read_time;
JOIN_TAB *table;
KEYUSE *key;
} POSITION;
......@@ -133,8 +134,9 @@ typedef struct st_rollup
class JOIN :public Sql_alloc
{
public:
JOIN_TAB *join_tab,**best_ref,**map2table;
JOIN_TAB *join_tab_save; //saved join_tab for subquery reexecution
JOIN_TAB *join_tab,**best_ref;
JOIN_TAB **map2table; // mapping between table indexes and JOIN_TABs
JOIN_TAB *join_tab_save; // saved join_tab for subquery reexecution
TABLE **table,**all_tables,*sort_by_table;
uint tables,const_tables;
uint send_group_parts;
......
......@@ -1845,6 +1845,11 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
end= strend(pos);
break;
}
case SHOW_DOUBLE:
{
end= buff + sprintf(buff, "%f", *(double*) value);
break;
}
#ifdef HAVE_OPENSSL
/* First group - functions relying on CTX */
case SHOW_SSL_CTX_SESS_ACCEPT:
......
......@@ -232,6 +232,102 @@ TEST_join(JOIN *join)
DBUG_VOID_RETURN;
}
/*
Print the current state during query optimization.
SYNOPSIS
print_plan()
join pointer to the structure providing all context info for
the query
read_time the cost of the best partial plan
record_count estimate for the number of records returned by the best
partial plan
idx length of the partial QEP in 'join->positions';
also an index in the array 'join->best_ref';
info comment string to appear above the printout
DESCRIPTION
This function prints to the log file DBUG_FILE the members of 'join' that
are used during query optimization (join->positions, join->best_positions,
and join->best_ref) and few other related variables (read_time,
record_count).
Useful to trace query optimizer functions.
RETURN
None
*/
void
print_plan(JOIN* join, double read_time, double record_count,
uint idx, const char *info)
{
uint i;
POSITION pos;
JOIN_TAB *join_table;
JOIN_TAB **plan_nodes;
TABLE* table;
if (info == 0)
info= "";
DBUG_LOCK_FILE;
if (join->best_read == DBL_MAX)
{
fprintf(DBUG_FILE,"%s; idx:%u, best: DBL_MAX, current:%g\n",
info, idx, read_time);
}
else
{
fprintf(DBUG_FILE,"%s; idx: %u, best: %g, current: %g\n",
info, idx, join->best_read, read_time);
}
/* Print the tables in JOIN->positions */
fputs(" POSITIONS: ", DBUG_FILE);
for (i= 0; i < idx ; i++)
{
pos = join->positions[i];
table= pos.table->table;
if (table)
fputs(table->real_name, DBUG_FILE);
fputc(' ', DBUG_FILE);
}
fputc('\n', DBUG_FILE);
/*
Print the tables in JOIN->best_positions only if at least one complete plan
has been found. An indicator for this is the value of 'join->best_read'.
*/
fputs("BEST_POSITIONS: ", DBUG_FILE);
if (join->best_read < DBL_MAX)
{
for (i= 0; i < idx ; i++)
{
pos= join->best_positions[i];
table= pos.table->table;
if (table)
fputs(table->real_name, DBUG_FILE);
fputc(' ', DBUG_FILE);
}
}
fputc('\n', DBUG_FILE);
/* Print the tables in JOIN->best_ref */
fputs(" BEST_REF: ", DBUG_FILE);
for (plan_nodes= join->best_ref ; *plan_nodes ; plan_nodes++)
{
join_table= (*plan_nodes);
fputs(join_table->table->real_name, DBUG_FILE);
fprintf(DBUG_FILE, "(%u,%u,%u)",
join_table->found_records, join_table->records, join_table->read_time);
fputc(' ', DBUG_FILE);
}
fputc('\n', DBUG_FILE);
DBUG_UNLOCK_FILE;
}
#endif
typedef struct st_debug_lock
......
......@@ -167,8 +167,8 @@ typedef struct st_known_date_time_format {
enum SHOW_TYPE
{
SHOW_UNDEF,
SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_BOOL,
SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUESTION,
SHOW_LONG, SHOW_LONGLONG, SHOW_INT, SHOW_CHAR, SHOW_CHAR_PTR, SHOW_DOUBLE,
SHOW_BOOL, SHOW_MY_BOOL, SHOW_OPENTABLES, SHOW_STARTTIME, SHOW_QUESTION,
SHOW_LONG_CONST, SHOW_INT_CONST, SHOW_HAVE, SHOW_SYS, SHOW_HA_ROWS,
#ifdef HAVE_OPENSSL
SHOW_SSL_CTX_SESS_ACCEPT, SHOW_SSL_CTX_SESS_ACCEPT_GOOD,
......
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