summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/filesort.cc1
-rw-r--r--sql/lex.h2
-rw-r--r--sql/mysqld.cc12
-rw-r--r--sql/protocol.cc2
-rw-r--r--sql/sql_class.h4
-rw-r--r--sql/sql_derived.cc2
-rw-r--r--sql/sql_help.cc4
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_yacc.yy8
9 files changed, 20 insertions, 17 deletions
diff --git a/sql/filesort.cc b/sql/filesort.cc
index e1ef9c26008..6bc0fc957a9 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -70,7 +70,6 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
int error;
ulong memavl;
uint maxbuffer;
- uint i;
BUFFPEK *buffpek;
ha_rows records;
uchar **sort_keys;
diff --git a/sql/lex.h b/sql/lex.h
index d4ae8c32828..287439a9fe7 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -290,7 +290,7 @@ static SYMBOL symbols[] = {
{ "PACK_KEYS", SYM(PACK_KEYS_SYM),0,0},
{ "PARTIAL", SYM(PARTIAL),0,0},
{ "PASSWORD", SYM(PASSWORD),0,0},
- { "POINT", SYM(POINT),0,0},
+ { "POINT", SYM(POINT_SYM),0,0},
{ "POLYGON", SYM(POLYGON),0,0},
{ "PURGE", SYM(PURGE),0,0},
{ "PRECISION", SYM(PRECISION),0,0},
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 1be832964b9..0ed317e7293 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -192,7 +192,6 @@ static char szPipeName [ 257 ];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
-static bool opt_enable_named_pipe = 0;
#endif
#ifdef __WIN__
static pthread_cond_t COND_handler_count;
@@ -502,9 +501,11 @@ static bool read_init_file(char *file_name);
#ifdef __NT__
extern "C" pthread_handler_decl(handle_connections_namedpipes,arg);
#endif
+#if !defined(EMBEDDED_LIBRARY)
#ifdef HAVE_SMEM
static pthread_handler_decl(handle_connections_shared_memory,arg);
#endif
+#endif /* EMBEDDED_LIBRARY */
extern "C" pthread_handler_decl(handle_slave,arg);
#ifdef SET_RLIMIT_NOFILE
static uint set_maximum_open_files(uint max_file_limit);
@@ -2242,6 +2243,7 @@ static void create_maintenance_thread()
static void create_shutdown_thread()
{
+#if !defined(EMBEDDED_LIBRARY)
#ifdef __WIN__
hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name);
pthread_t hThread;
@@ -2257,6 +2259,7 @@ static void create_shutdown_thread()
if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0))
sql_print_error("Warning: Can't create thread to handle shutdown requests");
#endif
+#endif // EMBEDDED_LIBRARY
}
@@ -2300,6 +2303,7 @@ static void handle_connections_methods()
handler_count--;
}
}
+#if !defined(EMBEDDED_LIBRARY)
#ifdef HAVE_SMEM
if (opt_enable_shared_memory)
{
@@ -2311,7 +2315,8 @@ static void handle_connections_methods()
handler_count--;
}
}
-#endif
+#endif
+#endif // EMBEDDED_LIBRARY
while (handler_count > 0)
pthread_cond_wait(&COND_handler_count,&LOCK_thread_count);
@@ -2676,11 +2681,10 @@ int main(int argc, char **argv)
static int bootstrap(FILE *file)
{
- THD *thd;
int error= 0;
DBUG_ENTER("bootstrap");
#ifndef EMBEDDED_LIBRARY // TODO: Enable this
- thd= new THD;
+ THD *thd= new THD;
thd->bootstrap=1;
thd->client_capabilities=0;
my_net_init(&thd->net,(st_vio*) 0);
diff --git a/sql/protocol.cc b/sql/protocol.cc
index ebee87806db..9a7a913f874 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -55,8 +55,10 @@ inline bool Protocol::convert_str(const char *from, uint length)
void send_error(THD *thd, uint sql_errno, const char *err)
{
+#ifndef EMBEDDED_LIBRARY
uint length;
char buff[MYSQL_ERRMSG_SIZE+2];
+#endif
NET *net= &thd->net;
DBUG_ENTER("send_error");
DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno,
diff --git a/sql/sql_class.h b/sql/sql_class.h
index ccbd7a194f2..41a2b77d50b 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -355,10 +355,6 @@ class select_result;
#define THD_SENTRY_MAGIC 0xfeedd1ff
#define THD_SENTRY_GONE 0xdeadbeef
-#ifdef EMBEDDED_LIBRARY
-typedef struct st_mysql;
-#endif
-
#define THD_CHECK_SENTRY(thd) DBUG_ASSERT(thd->dbug_sentry == THD_SENTRY_MAGIC)
struct system_variables
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index f1a5912cfdb..406a534daea 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -71,7 +71,7 @@ int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
select_union *derived_result;
TABLE_LIST *tables= (TABLE_LIST *)sl->table_list.first;
TMP_TABLE_PARAM tmp_table_param;
- bool is_union= sl->next_select();
+ bool is_union= sl->next_select() ? 1 : 0;
bool is_subsel= sl->first_inner_unit() ? 1: 0;
SELECT_LEX_NODE *save_current_select= lex->current_select;
DBUG_ENTER("mysql_derived");
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 24ea2e9734e..def36665fb5 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -254,7 +254,7 @@ int get_all_topics_for_category(THD *thd, TABLE *topics, TABLE *relations,
rcat_id->get_key_image(buff, rcat_id->pack_length(), help_charset,
Field::itRAW);
int key_res= relations->file->index_read(relations->record[0],
- buff, rcat_id->pack_length(),
+ (byte *)buff, rcat_id->pack_length(),
HA_READ_KEY_EXACT);
for ( ; !key_res && cat_id == (int16) rcat_id->val_int() ;
@@ -267,7 +267,7 @@ int get_all_topics_for_category(THD *thd, TABLE *topics, TABLE *relations,
field->get_key_image(topic_id_buff, field->pack_length(), help_charset,
Field::itRAW);
- if (!topics->file->index_read(topics->record[0], topic_id_buff,
+ if (!topics->file->index_read(topics->record[0], (byte *)topic_id_buff,
field->pack_length(),
HA_READ_KEY_EXACT))
res->push_back(get_field(&thd->mem_root,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index d69f95e7248..ce782b0480c 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1059,7 +1059,9 @@ bool do_command(THD *thd)
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length)
{
+#ifndef EMBEDDED_LIBRARY
int res;
+#endif
NET *net= &thd->net;
bool error= 0;
/*
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b9c0167bc05..7c7e5e024dd 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -486,7 +486,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token NOW_SYM
%token PASSWORD
%token POINTFROMTEXT
-%token POINT
+%token POINT_SYM
%token POLYFROMTEXT
%token POLYGON
%token POSITION_SYM
@@ -1146,7 +1146,7 @@ type:
$$=FIELD_TYPE_BLOB; }
| GEOMETRY_SYM { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_GEOMETRY; }
- | POINT { Lex->charset=&my_charset_bin;
+ | POINT_SYM { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_GEOMETRY; }
| MULTIPOINT { Lex->charset=&my_charset_bin;
$$=FIELD_TYPE_GEOMETRY; }
@@ -2313,7 +2313,7 @@ simple_expr:
{ $$= new Item_func_password($3); }
| PASSWORD '(' expr ',' expr ')'
{ $$= new Item_func_password($3,$5); }
- | POINT '(' expr ',' expr ')'
+ | POINT_SYM '(' expr ',' expr ')'
{ $$= new Item_func_point($3,$5); }
| POINTFROMTEXT '(' expr ')'
{ $$= new Item_func_geometry_from_text($3); }
@@ -4038,7 +4038,7 @@ keyword:
| PACK_KEYS_SYM {}
| PARTIAL {}
| PASSWORD {}
- | POINT {}
+ | POINT_SYM {}
| POLYGON {}
| PREV_SYM {}
| PROCESS {}