Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
815bd107
Commit
815bd107
authored
Aug 21, 2000
by
serg@infomag.ape.relarn.ru
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
48ee575e
50965c5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
77 deletions
+77
-77
sql/item_func.h
sql/item_func.h
+1
-2
sql/sql_parse.cc
sql/sql_parse.cc
+40
-40
sql/sql_yacc.yy
sql/sql_yacc.yy
+36
-35
No files found.
sql/item_func.h
View file @
815bd107
...
@@ -829,7 +829,7 @@ class Item_func_inet_aton : public Item_int_func
...
@@ -829,7 +829,7 @@ class Item_func_inet_aton : public Item_int_func
};
};
/*
SerG:
for fulltext search */
/* for fulltext search */
#include <ft_global.h>
#include <ft_global.h>
class
Item_func_match
:
public
Item_real_func
class
Item_func_match
:
public
Item_real_func
...
@@ -855,4 +855,3 @@ class Item_func_match :public Item_real_func
...
@@ -855,4 +855,3 @@ class Item_func_match :public Item_real_func
double
val
();
double
val
();
longlong
val_int
()
{
return
val
()
!=
0.0
;
}
longlong
val_int
()
{
return
val
()
!=
0.0
;
}
};
};
sql/sql_parse.cc
View file @
815bd107
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
(at your option) any later version.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
...
@@ -172,7 +172,7 @@ check_connections(THD *thd)
...
@@ -172,7 +172,7 @@ check_connections(THD *thd)
if
(
!
thd
->
host
)
// If TCP/IP connection
if
(
!
thd
->
host
)
// If TCP/IP connection
{
{
char
ip
[
17
];
char
ip
[
17
];
if
(
vio_peer_addr
(
net
->
vio
,
ip
))
if
(
vio_peer_addr
(
net
->
vio
,
ip
))
return
(
ER_BAD_HOST_ERROR
);
return
(
ER_BAD_HOST_ERROR
);
if
(
!
(
thd
->
ip
=
my_strdup
(
ip
,
MYF
(
0
))))
if
(
!
(
thd
->
ip
=
my_strdup
(
ip
,
MYF
(
0
))))
...
@@ -182,7 +182,7 @@ check_connections(THD *thd)
...
@@ -182,7 +182,7 @@ check_connections(THD *thd)
if
(
!
strcmp
(
thd
->
ip
,
"127.0.0.1"
))
if
(
!
strcmp
(
thd
->
ip
,
"127.0.0.1"
))
{
{
if
(
!
(
thd
->
host
=
my_strdup
(
"localhost"
,
MYF
(
0
))))
if
(
!
(
thd
->
host
=
my_strdup
(
"localhost"
,
MYF
(
0
))))
return
(
ER_OUT_OF_RESOURCES
);
return
(
ER_OUT_OF_RESOURCES
);
}
}
else
else
#endif
#endif
...
@@ -499,7 +499,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
...
@@ -499,7 +499,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
table_list
->
lock_type
=
TL_READ_NO_INSERT
;
table_list
->
lock_type
=
TL_READ_NO_INSERT
;
table_list
->
next
=
0
;
table_list
->
next
=
0
;
remove_escape
(
table_list
->
real_name
);
remove_escape
(
table_list
->
real_name
);
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
TL_READ_NO_INSERT
)))
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
TL_READ_NO_INSERT
)))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
@@ -519,12 +519,12 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
...
@@ -519,12 +519,12 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
error
=
table
->
file
->
dump
(
thd
,
fd
);
error
=
table
->
file
->
dump
(
thd
,
fd
);
if
(
error
)
if
(
error
)
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
my_error
(
ER_GET_ERRNO
,
MYF
(
0
));
err:
err:
close_thread_tables
(
thd
);
close_thread_tables
(
thd
);
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
@@ -592,7 +592,7 @@ bool do_command(THD *thd)
...
@@ -592,7 +592,7 @@ bool do_command(THD *thd)
tbl_name
[
tbl_len
]
=
0
;
tbl_name
[
tbl_len
]
=
0
;
if
(
mysql_table_dump
(
thd
,
db
,
tbl_name
,
-
1
))
if
(
mysql_table_dump
(
thd
,
db
,
tbl_name
,
-
1
))
send_error
(
&
thd
->
net
);
// dump to NET
send_error
(
&
thd
->
net
);
// dump to NET
break
;
break
;
}
}
case
COM_CHANGE_USER
:
case
COM_CHANGE_USER
:
...
@@ -712,7 +712,7 @@ bool do_command(THD *thd)
...
@@ -712,7 +712,7 @@ bool do_command(THD *thd)
if
(
check_access
(
thd
,
FILE_ACL
,
any_db
))
if
(
check_access
(
thd
,
FILE_ACL
,
any_db
))
break
;
break
;
mysql_log
.
write
(
command
,
0
);
mysql_log
.
write
(
command
,
0
);
ulong
pos
;
ulong
pos
;
ushort
flags
;
ushort
flags
;
pos
=
uint4korr
(
packet
+
1
);
pos
=
uint4korr
(
packet
+
1
);
...
@@ -949,7 +949,7 @@ mysql_execute_command(void)
...
@@ -949,7 +949,7 @@ mysql_execute_command(void)
break
;
break
;
}
}
case
SQLCOM_LOAD_MASTER_TABLE
:
case
SQLCOM_LOAD_MASTER_TABLE
:
if
(
!
tables
->
db
)
if
(
!
tables
->
db
)
tables
->
db
=
thd
->
db
;
tables
->
db
=
thd
->
db
;
if
(
check_access
(
thd
,
CREATE_ACL
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
if
(
check_access
(
thd
,
CREATE_ACL
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
...
@@ -982,11 +982,11 @@ mysql_execute_command(void)
...
@@ -982,11 +982,11 @@ mysql_execute_command(void)
// this way we make sure that when we are done, we are clean
// this way we make sure that when we are done, we are clean
break
;
break
;
}
}
res
=
0
;
res
=
0
;
send_ok
(
&
thd
->
net
);
send_ok
(
&
thd
->
net
);
break
;
break
;
case
SQLCOM_CREATE_TABLE
:
case
SQLCOM_CREATE_TABLE
:
#ifdef DEMO_VERSION
#ifdef DEMO_VERSION
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
...
@@ -1081,7 +1081,7 @@ mysql_execute_command(void)
...
@@ -1081,7 +1081,7 @@ mysql_execute_command(void)
case
SQLCOM_SLAVE_STOP
:
case
SQLCOM_SLAVE_STOP
:
stop_slave
(
thd
);
stop_slave
(
thd
);
break
;
break
;
case
SQLCOM_ALTER_TABLE
:
case
SQLCOM_ALTER_TABLE
:
#if defined(DONT_ALLOW_SHOW_COMMANDS)
#if defined(DONT_ALLOW_SHOW_COMMANDS)
...
@@ -1137,7 +1137,7 @@ mysql_execute_command(void)
...
@@ -1137,7 +1137,7 @@ mysql_execute_command(void)
if
(
mysql_rename_tables
(
thd
,
tables
))
if
(
mysql_rename_tables
(
thd
,
tables
))
res
=
-
1
;
res
=
-
1
;
break
;
break
;
case
SQLCOM_SHOW_CREATE
:
case
SQLCOM_SHOW_CREATE
:
/* SerG:show */
#ifdef DONT_ALLOW_SHOW_COMMANDS
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1147,7 +1147,7 @@ mysql_execute_command(void)
...
@@ -1147,7 +1147,7 @@ mysql_execute_command(void)
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
tables
->
db
,
check_access
(
thd
,
SELECT_ACL
|
EXTRA_ACL
,
tables
->
db
,
&
tables
->
grant
.
privilege
))
&
tables
->
grant
.
privilege
))
goto
error
;
goto
error
;
res
=
mysqld_show_create
(
thd
,
tables
);
res
=
mysqld_show_create
(
thd
,
tables
);
break
;
break
;
}
}
#endif
#endif
...
@@ -1385,7 +1385,7 @@ mysql_execute_command(void)
...
@@ -1385,7 +1385,7 @@ mysql_execute_command(void)
break
;
break
;
}
}
#endif
#endif
case
SQLCOM_SHOW_FIELDS
:
case
SQLCOM_SHOW_FIELDS
:
/* SerG:show */
#ifdef DONT_ALLOW_SHOW_COMMANDS
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1411,7 +1411,7 @@ mysql_execute_command(void)
...
@@ -1411,7 +1411,7 @@ mysql_execute_command(void)
break
;
break
;
}
}
#endif
#endif
case
SQLCOM_SHOW_KEYS
:
case
SQLCOM_SHOW_KEYS
:
/* SerG:show */
#ifdef DONT_ALLOW_SHOW_COMMANDS
#ifdef DONT_ALLOW_SHOW_COMMANDS
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
send_error
(
&
thd
->
net
,
ER_NOT_ALLOWED_COMMAND
);
/* purecov: inspected */
DBUG_VOID_RETURN
;
DBUG_VOID_RETURN
;
...
@@ -1474,7 +1474,7 @@ mysql_execute_command(void)
...
@@ -1474,7 +1474,7 @@ mysql_execute_command(void)
if
(
org_options
&
OPTION_AUTO_COMMIT
)
if
(
org_options
&
OPTION_AUTO_COMMIT
)
{
{
/* We changed to auto_commit mode */
/* We changed to auto_commit mode */
thd
->
options
&=
~
OPTION_BEGIN
;
thd
->
options
&=
~
OPTION_BEGIN
;
thd
->
server_status
|=
SERVER_STATUS_AUTOCOMMIT
;
thd
->
server_status
|=
SERVER_STATUS_AUTOCOMMIT
;
if
(
ha_commit
(
thd
))
if
(
ha_commit
(
thd
))
{
{
...
@@ -1483,7 +1483,7 @@ mysql_execute_command(void)
...
@@ -1483,7 +1483,7 @@ mysql_execute_command(void)
}
}
}
}
else
else
thd
->
server_status
&=
~
SERVER_STATUS_AUTOCOMMIT
;
thd
->
server_status
&=
~
SERVER_STATUS_AUTOCOMMIT
;
}
}
send_ok
(
&
thd
->
net
);
send_ok
(
&
thd
->
net
);
break
;
break
;
...
@@ -2368,7 +2368,7 @@ bool reload_acl_and_cache(uint options)
...
@@ -2368,7 +2368,7 @@ bool reload_acl_and_cache(uint options)
reset_master
();
reset_master
();
if
(
options
&
REFRESH_SLAVE
)
if
(
options
&
REFRESH_SLAVE
)
reset_slave
();
reset_slave
();
return
result
;
return
result
;
}
}
...
@@ -2441,7 +2441,7 @@ static int start_slave(THD* thd , bool net_report)
...
@@ -2441,7 +2441,7 @@ static int start_slave(THD* thd , bool net_report)
if
(
!
slave_running
)
if
(
!
slave_running
)
if
(
master_host
)
if
(
master_host
)
{
{
pthread_t
hThread
;
pthread_t
hThread
;
if
(
pthread_create
(
&
hThread
,
&
connection_attrib
,
handle_slave
,
0
))
if
(
pthread_create
(
&
hThread
,
&
connection_attrib
,
handle_slave
,
0
))
{
{
err
=
"cannot create slave thread"
;
err
=
"cannot create slave thread"
;
...
@@ -2456,7 +2456,7 @@ static int start_slave(THD* thd , bool net_report)
...
@@ -2456,7 +2456,7 @@ static int start_slave(THD* thd , bool net_report)
if
(
err
)
if
(
err
)
{
{
if
(
net_report
)
send_error
(
net
,
0
,
err
);
if
(
net_report
)
send_error
(
net
,
0
,
err
);
return
1
;
return
1
;
}
}
else
if
(
net_report
)
else
if
(
net_report
)
send_ok
(
net
);
send_ok
(
net
);
...
@@ -2469,10 +2469,10 @@ static int stop_slave(THD* thd, bool net_report )
...
@@ -2469,10 +2469,10 @@ static int stop_slave(THD* thd, bool net_report )
if
(
!
thd
)
thd
=
current_thd
;
if
(
!
thd
)
thd
=
current_thd
;
NET
*
net
=
&
thd
->
net
;
NET
*
net
=
&
thd
->
net
;
const
char
*
err
=
0
;
const
char
*
err
=
0
;
if
(
check_access
(
thd
,
PROCESS_ACL
,
any_db
))
if
(
check_access
(
thd
,
PROCESS_ACL
,
any_db
))
return
1
;
return
1
;
pthread_mutex_lock
(
&
LOCK_slave
);
pthread_mutex_lock
(
&
LOCK_slave
);
if
(
slave_running
)
if
(
slave_running
)
{
{
...
@@ -2485,10 +2485,10 @@ static int stop_slave(THD* thd, bool net_report )
...
@@ -2485,10 +2485,10 @@ static int stop_slave(THD* thd, bool net_report )
}
}
else
else
err
=
"Slave is not running"
;
err
=
"Slave is not running"
;
pthread_mutex_unlock
(
&
LOCK_slave
);
pthread_mutex_unlock
(
&
LOCK_slave
);
thd
->
proc_info
=
0
;
thd
->
proc_info
=
0
;
if
(
err
)
if
(
err
)
{
{
if
(
net_report
)
send_error
(
net
,
0
,
err
);
if
(
net_report
)
send_error
(
net
,
0
,
err
);
...
@@ -2505,15 +2505,15 @@ static void reset_slave()
...
@@ -2505,15 +2505,15 @@ static void reset_slave()
MY_STAT
stat_area
;
MY_STAT
stat_area
;
char
fname
[
FN_REFLEN
];
char
fname
[
FN_REFLEN
];
bool
slave_was_running
=
slave_running
;
bool
slave_was_running
=
slave_running
;
if
(
slave_running
)
if
(
slave_running
)
stop_slave
(
0
,
0
);
stop_slave
(
0
,
0
);
fn_format
(
fname
,
master_info_file
,
mysql_data_home
,
""
,
4
+
16
+
32
);
fn_format
(
fname
,
master_info_file
,
mysql_data_home
,
""
,
4
+
16
+
32
);
if
(
my_stat
(
fname
,
&
stat_area
,
MYF
(
0
)))
if
(
my_stat
(
fname
,
&
stat_area
,
MYF
(
0
)))
if
(
my_delete
(
fname
,
MYF
(
MY_WME
)))
if
(
my_delete
(
fname
,
MYF
(
MY_WME
)))
return
;
return
;
if
(
slave_was_running
)
if
(
slave_was_running
)
start_slave
(
0
,
0
);
start_slave
(
0
,
0
);
}
}
...
@@ -2533,7 +2533,7 @@ static int change_master(THD* thd)
...
@@ -2533,7 +2533,7 @@ static int change_master(THD* thd)
pthread_mutex_unlock
(
&
LOCK_slave
);
pthread_mutex_unlock
(
&
LOCK_slave
);
thd
->
proc_info
=
"changing master"
;
thd
->
proc_info
=
"changing master"
;
LEX_MASTER_INFO
*
lex_mi
=
&
thd
->
lex
.
mi
;
LEX_MASTER_INFO
*
lex_mi
=
&
thd
->
lex
.
mi
;
pthread_mutex_lock
(
&
glob_mi
.
lock
);
pthread_mutex_lock
(
&
glob_mi
.
lock
);
if
((
lex_mi
->
host
||
lex_mi
->
port
)
&&
!
lex_mi
->
log_file_name
&&
!
lex_mi
->
pos
)
if
((
lex_mi
->
host
||
lex_mi
->
port
)
&&
!
lex_mi
->
log_file_name
&&
!
lex_mi
->
pos
)
{
{
...
@@ -2547,7 +2547,7 @@ static int change_master(THD* thd)
...
@@ -2547,7 +2547,7 @@ static int change_master(THD* thd)
sizeof
(
glob_mi
.
log_file_name
));
sizeof
(
glob_mi
.
log_file_name
));
if
(
lex_mi
->
pos
)
if
(
lex_mi
->
pos
)
glob_mi
.
pos
=
lex_mi
->
pos
;
glob_mi
.
pos
=
lex_mi
->
pos
;
if
(
lex_mi
->
host
)
if
(
lex_mi
->
host
)
strmake
(
glob_mi
.
host
,
lex_mi
->
host
,
sizeof
(
glob_mi
.
host
));
strmake
(
glob_mi
.
host
,
lex_mi
->
host
,
sizeof
(
glob_mi
.
host
));
if
(
lex_mi
->
user
)
if
(
lex_mi
->
user
)
...
@@ -2558,14 +2558,14 @@ static int change_master(THD* thd)
...
@@ -2558,14 +2558,14 @@ static int change_master(THD* thd)
glob_mi
.
port
=
lex_mi
->
port
;
glob_mi
.
port
=
lex_mi
->
port
;
if
(
lex_mi
->
connect_retry
)
if
(
lex_mi
->
connect_retry
)
glob_mi
.
connect_retry
=
lex_mi
->
connect_retry
;
glob_mi
.
connect_retry
=
lex_mi
->
connect_retry
;
flush_master_info
(
&
glob_mi
);
flush_master_info
(
&
glob_mi
);
pthread_mutex_unlock
(
&
glob_mi
.
lock
);
pthread_mutex_unlock
(
&
glob_mi
.
lock
);
thd
->
proc_info
=
"starting slave"
;
thd
->
proc_info
=
"starting slave"
;
if
(
slave_was_running
)
if
(
slave_was_running
)
start_slave
(
0
,
0
);
start_slave
(
0
,
0
);
thd
->
proc_info
=
0
;
thd
->
proc_info
=
0
;
send_ok
(
&
thd
->
net
);
send_ok
(
&
thd
->
net
);
return
0
;
return
0
;
}
}
...
@@ -2603,9 +2603,9 @@ static void reset_master()
...
@@ -2603,9 +2603,9 @@ static void reset_master()
strmov
(
strcend
(
tmp
,
'.'
),
"-bin"
);
strmov
(
strcend
(
tmp
,
'.'
),
"-bin"
);
opt_bin_logname
=
tmp
;
opt_bin_logname
=
tmp
;
}
}
mysql_bin_log
.
open
(
opt_bin_logname
,
LOG_BIN
);
mysql_bin_log
.
open
(
opt_bin_logname
,
LOG_BIN
);
}
}
int
show_binlog_info
(
THD
*
thd
)
int
show_binlog_info
(
THD
*
thd
)
...
@@ -2616,12 +2616,12 @@ int show_binlog_info(THD* thd)
...
@@ -2616,12 +2616,12 @@ int show_binlog_info(THD* thd)
field_list
.
push_back
(
new
Item_empty_string
(
"Position"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Position"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Binlog_do_db"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Binlog_do_db"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Binlog_ignore_db"
,
20
));
field_list
.
push_back
(
new
Item_empty_string
(
"Binlog_ignore_db"
,
20
));
if
(
send_fields
(
thd
,
field_list
,
1
))
if
(
send_fields
(
thd
,
field_list
,
1
))
DBUG_RETURN
(
-
1
);
DBUG_RETURN
(
-
1
);
String
*
packet
=
&
thd
->
packet
;
String
*
packet
=
&
thd
->
packet
;
packet
->
length
(
0
);
packet
->
length
(
0
);
if
(
mysql_bin_log
.
is_open
())
if
(
mysql_bin_log
.
is_open
())
{
{
LOG_INFO
li
;
LOG_INFO
li
;
...
...
sql/sql_yacc.yy
View file @
815bd107
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
(at your option) any later version.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
#include "sql_acl.h"
#include "sql_acl.h"
#include "lex_symbol.h"
#include "lex_symbol.h"
#include <myisam.h>
#include <myisam.h>
extern void yyerror(const char*);
extern void yyerror(const char*);
int yylex(void *yylval);
int yylex(void *yylval);
...
@@ -451,7 +451,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
...
@@ -451,7 +451,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
literal text_literal insert_ident group_ident order_ident
literal text_literal insert_ident group_ident order_ident
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
simple_ident select_item2 expr opt_expr opt_else sum_expr in_sum_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
table_wild opt_pad no_in_expr expr_expr simple_expr no_and_expr
using_list
using_list
%type <item_list>
%type <item_list>
expr_list udf_expr_list when_list ident_list
expr_list udf_expr_list when_list ident_list
...
@@ -548,7 +548,7 @@ verb_clause:
...
@@ -548,7 +548,7 @@ verb_clause:
| rollback
| rollback
| select
| select
| set
| set
| slave
| slave
| show
| show
| unlock
| unlock
| update
| update
...
@@ -557,7 +557,7 @@ verb_clause:
...
@@ -557,7 +557,7 @@ verb_clause:
/* change master */
/* change master */
change:
change:
CHANGE MASTER_SYM TO_SYM
CHANGE MASTER_SYM TO_SYM
{
{
LEX *lex = Lex;
LEX *lex = Lex;
lex->sql_command = SQLCOM_CHANGE_MASTER;
lex->sql_command = SQLCOM_CHANGE_MASTER;
...
@@ -568,7 +568,7 @@ master_defs:
...
@@ -568,7 +568,7 @@ master_defs:
master_def
master_def
|
|
master_defs ',' master_def
master_defs ',' master_def
master_def:
master_def:
MASTER_HOST_SYM EQ TEXT_STRING
MASTER_HOST_SYM EQ TEXT_STRING
{
{
...
@@ -604,9 +604,9 @@ master_def:
...
@@ -604,9 +604,9 @@ master_def:
{
{
Lex->mi.connect_retry = $3;
Lex->mi.connect_retry = $3;
}
}
/* create a table */
/* create a table */
create:
create:
...
@@ -614,7 +614,7 @@ create:
...
@@ -614,7 +614,7 @@ create:
{
{
LEX *lex=Lex;
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_TABLE;
lex->sql_command= SQLCOM_CREATE_TABLE;
if (!add_table_to_list($5,
if (!add_table_to_list($5,
($2 & HA_LEX_CREATE_TMP_TABLE ?
($2 & HA_LEX_CREATE_TMP_TABLE ?
&tmp_table_alias : (LEX_STRING*) 0)))
&tmp_table_alias : (LEX_STRING*) 0)))
YYABORT;
YYABORT;
...
@@ -678,7 +678,7 @@ create:
...
@@ -678,7 +678,7 @@ create:
}
}
create2:
create2:
'(' field_list ')' opt_create_table_options create3 {}
'(' field_list ')' opt_create_table_options create3 {}
| opt_create_table_options create3 {}
| opt_create_table_options create3 {}
create3:
create3:
...
@@ -690,18 +690,18 @@ create3:
...
@@ -690,18 +690,18 @@ create3:
select_options select_item_list opt_select_from {}
select_options select_item_list opt_select_from {}
opt_table_options:
opt_table_options:
/* empty */ { $$= 0; }
/* empty */ { $$= 0; }
| table_options { $$= $1;}
| table_options { $$= $1;}
table_options:
table_options:
table_option { $$=$1; }
table_option { $$=$1; }
| table_option table_options { $$= $1 | $2 }
| table_option table_options { $$= $1 | $2 }
table_option:
table_option:
TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
TEMPORARY { $$=HA_LEX_CREATE_TMP_TABLE; }
opt_if_not_exists:
opt_if_not_exists:
/* empty */ { $$= 0; }
/* empty */ { $$= 0; }
| IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
| IF NOT EXISTS { $$=HA_LEX_CREATE_IF_NOT_EXISTS; }
opt_create_table_options:
opt_create_table_options:
...
@@ -723,7 +723,7 @@ create_table_option:
...
@@ -723,7 +723,7 @@ create_table_option:
| PACK_KEYS_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_PACK_KEYS : HA_OPTION_NO_PACK_KEYS; }
| PACK_KEYS_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_PACK_KEYS : HA_OPTION_NO_PACK_KEYS; }
| CHECKSUM_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; }
| CHECKSUM_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_CHECKSUM : HA_OPTION_NO_CHECKSUM; }
| DELAY_KEY_WRITE_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; }
| DELAY_KEY_WRITE_SYM EQ ULONG_NUM { Lex->create_info.table_options|= $3 ? HA_OPTION_DELAY_KEY_WRITE : HA_OPTION_NO_DELAY_KEY_WRITE; }
| ROW_FORMAT_SYM EQ row_types { Lex->create_info.row_type= $3; }
| ROW_FORMAT_SYM EQ row_types { Lex->create_info.row_type= $3; }
| RAID_TYPE EQ raid_types { Lex->create_info.raid_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_TYPE EQ raid_types { Lex->create_info.raid_type= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKS EQ ULONG_NUM { Lex->create_info.raid_chunks= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKS EQ ULONG_NUM { Lex->create_info.raid_chunks= $3; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKSIZE EQ ULONG_NUM { Lex->create_info.raid_chunksize= $3*RAID_BLOCK_SIZE; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
| RAID_CHUNKSIZE EQ ULONG_NUM { Lex->create_info.raid_chunksize= $3*RAID_BLOCK_SIZE; Lex->create_info.used_fields|= HA_CREATE_USED_RAID;}
...
@@ -865,7 +865,7 @@ char:
...
@@ -865,7 +865,7 @@ char:
CHAR_SYM {}
CHAR_SYM {}
| NCHAR_SYM {}
| NCHAR_SYM {}
| NATIONAL_SYM CHAR_SYM {}
| NATIONAL_SYM CHAR_SYM {}
varchar:
varchar:
char VARYING {}
char VARYING {}
| VARCHAR {}
| VARCHAR {}
...
@@ -964,6 +964,7 @@ delete_option:
...
@@ -964,6 +964,7 @@ delete_option:
key_type:
key_type:
opt_constraint PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
opt_constraint PRIMARY_SYM KEY_SYM { $$= Key::PRIMARY; }
| key_or_index { $$= Key::MULTIPLE; }
| key_or_index { $$= Key::MULTIPLE; }
| COLLECTION { $$= Key::FULLTEXT; }
| opt_constraint UNIQUE_SYM { $$= Key::UNIQUE; }
| opt_constraint UNIQUE_SYM { $$= Key::UNIQUE; }
| opt_constraint UNIQUE_SYM key_or_index { $$= Key::UNIQUE; }
| opt_constraint UNIQUE_SYM key_or_index { $$= Key::UNIQUE; }
...
@@ -1095,7 +1096,7 @@ slave:
...
@@ -1095,7 +1096,7 @@ slave:
Lex->sql_command = SQLCOM_SLAVE_STOP;
Lex->sql_command = SQLCOM_SLAVE_STOP;
Lex->type = 0;
Lex->type = 0;
};
};
repair:
repair:
REPAIR table_or_tables
REPAIR table_or_tables
{
{
...
@@ -1123,7 +1124,7 @@ analyze:
...
@@ -1123,7 +1124,7 @@ analyze:
}
}
check:
check:
CHECK_SYM table_or_tables
CHECK_SYM table_or_tables
{
{
Lex->sql_command = SQLCOM_CHECK;
Lex->sql_command = SQLCOM_CHECK;
Lex->check_opt.init();
Lex->check_opt.init();
...
@@ -1238,7 +1239,7 @@ select_alias:
...
@@ -1238,7 +1239,7 @@ select_alias:
optional_braces:
optional_braces:
/* empty */ {}
/* empty */ {}
| '(' ')' {}
| '(' ')' {}
/* all possible expressions */
/* all possible expressions */
expr: expr_expr {$$ = $1; }
expr: expr_expr {$$ = $1; }
| simple_expr {$$ = $1; }
| simple_expr {$$ = $1; }
...
@@ -1380,7 +1381,7 @@ simple_expr:
...
@@ -1380,7 +1381,7 @@ simple_expr:
(Item_func_match *)($$=new Item_func_match(*$2,$5))); }
(Item_func_match *)($$=new Item_func_match(*$2,$5))); }
| BINARY expr %prec NEG { $$= new Item_func_binary($2); }
| BINARY expr %prec NEG { $$= new Item_func_binary($2); }
| CASE_SYM opt_expr WHEN_SYM when_list opt_else END
| CASE_SYM opt_expr WHEN_SYM when_list opt_else END
{ $$= new Item_func_case(* $4, $2, $5 ) }
{ $$= new Item_func_case(* $4, $2, $5 ) }
| FUNC_ARG0 '(' ')'
| FUNC_ARG0 '(' ')'
{ $$= ((Item*(*)(void))($1.symbol->create_func))();}
{ $$= ((Item*(*)(void))($1.symbol->create_func))();}
| FUNC_ARG1 '(' expr ')'
| FUNC_ARG1 '(' expr ')'
...
@@ -1574,7 +1575,7 @@ simple_expr:
...
@@ -1574,7 +1575,7 @@ simple_expr:
{ $$= new Item_func_yearweek($3, $5); }
{ $$= new Item_func_yearweek($3, $5); }
| BENCHMARK_SYM '(' ULONG_NUM ',' expr ')'
| BENCHMARK_SYM '(' ULONG_NUM ',' expr ')'
{ $$=new Item_func_benchmark($3,$5); }
{ $$=new Item_func_benchmark($3,$5); }
| EXTRACT_SYM '(' interval FROM expr ')'
| EXTRACT_SYM '(' interval FROM expr ')'
{ $$=new Item_extract( $3, $5); }
{ $$=new Item_extract( $3, $5); }
udf_expr_list:
udf_expr_list:
...
@@ -1645,12 +1646,12 @@ when_list:
...
@@ -1645,12 +1646,12 @@ when_list:
{ $$= Lex->when_list.pop(); }
{ $$= Lex->when_list.pop(); }
when_list2:
when_list2:
expr THEN_SYM expr
expr THEN_SYM expr
{
{
Lex->when_list.head()->push_back($1);
Lex->when_list.head()->push_back($1);
Lex->when_list.head()->push_back($3);
Lex->when_list.head()->push_back($3);
}
}
| when_list2 WHEN_SYM expr THEN_SYM expr
| when_list2 WHEN_SYM expr THEN_SYM expr
{
{
Lex->when_list.head()->push_back($3);
Lex->when_list.head()->push_back($3);
Lex->when_list.head()->push_back($5);
Lex->when_list.head()->push_back($5);
...
@@ -2113,11 +2114,11 @@ show_param:
...
@@ -2113,11 +2114,11 @@ show_param:
| MASTER_SYM STATUS_SYM
| MASTER_SYM STATUS_SYM
{
{
Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
Lex->sql_command = SQLCOM_SHOW_MASTER_STAT;
}
}
| SLAVE STATUS_SYM
| SLAVE STATUS_SYM
{
{
Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
Lex->sql_command = SQLCOM_SHOW_SLAVE_STAT;
}
}
opt_db:
opt_db:
/* empty */ { $$= 0; }
/* empty */ { $$= 0; }
...
@@ -2166,8 +2167,8 @@ flush_option:
...
@@ -2166,8 +2167,8 @@ flush_option:
| PRIVILEGES { Lex->type|= REFRESH_GRANT; }
| PRIVILEGES { Lex->type|= REFRESH_GRANT; }
| LOGS_SYM { Lex->type|= REFRESH_LOG; }
| LOGS_SYM { Lex->type|= REFRESH_LOG; }
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| STATUS_SYM { Lex->type|= REFRESH_STATUS; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
| SLAVE { Lex->type|= REFRESH_SLAVE; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
| MASTER_SYM { Lex->type|= REFRESH_MASTER; }
/* kill threads */
/* kill threads */
...
@@ -2200,13 +2201,13 @@ load: LOAD DATA_SYM opt_low_priority opt_local INFILE TEXT_STRING
...
@@ -2200,13 +2201,13 @@ load: LOAD DATA_SYM opt_low_priority opt_local INFILE TEXT_STRING
YYABORT;
YYABORT;
}
}
|
|
LOAD TABLE_SYM table_ident FROM MASTER_SYM
LOAD TABLE_SYM table_ident FROM MASTER_SYM
{
{
Lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
Lex->sql_command = SQLCOM_LOAD_MASTER_TABLE;
if (!add_table_to_list($3,NULL))
if (!add_table_to_list($3,NULL))
YYABORT;
YYABORT;
}
}
opt_local:
opt_local:
/* empty */ { $$=0;}
/* empty */ { $$=0;}
...
@@ -2329,7 +2330,7 @@ ident:
...
@@ -2329,7 +2330,7 @@ ident:
ident_or_text:
ident_or_text:
ident { $$=$1;}
ident { $$=$1;}
| TEXT_STRING { $$=$1;}
| TEXT_STRING { $$=$1;}
| LEX_HOSTNAME { $$=$1;}
| LEX_HOSTNAME { $$=$1;}
user:
user:
...
@@ -2412,10 +2413,10 @@ keyword:
...
@@ -2412,10 +2413,10 @@ keyword:
| PROCESSLIST_SYM {}
| PROCESSLIST_SYM {}
| QUICK {}
| QUICK {}
| RAID_0_SYM {}
| RAID_0_SYM {}
| RAID_CHUNKS {}
| RAID_CHUNKS {}
| RAID_CHUNKSIZE {}
| RAID_CHUNKSIZE {}
| RAID_STRIPED_SYM {}
| RAID_STRIPED_SYM {}
| RAID_TYPE {}
| RAID_TYPE {}
| RELOAD {}
| RELOAD {}
| REPAIR {}
| REPAIR {}
| ROLLBACK_SYM {}
| ROLLBACK_SYM {}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment