diff options
author | unknown <tsmith@quadxeon.mysql.com> | 2007-03-07 07:21:24 +0100 |
---|---|---|
committer | unknown <tsmith@quadxeon.mysql.com> | 2007-03-07 07:21:24 +0100 |
commit | a69a96e26a06d08d5f1060469c630f6296c64dfc (patch) | |
tree | 3b6fe53494b0d386d485258b18617577fa500e46 /sql/sql_class.cc | |
parent | 0ac63815ff77c208b1312427cda72b9680d03709 (diff) | |
parent | 01fc4d068466234ceeea20a0f8ae0e77e36fd90f (diff) | |
download | mariadb-git-a69a96e26a06d08d5f1060469c630f6296c64dfc.tar.gz |
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/51
client/mysqltest.c:
Auto merged
include/my_pthread.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysys/my_wincond.c:
Auto merged
sql/event_queue.cc:
Auto merged
sql/field.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
client/mysql_upgrade.c:
Manual merge; I chose to keep Magnus' changes because they make the code
more simple; always use *only* the option file created by mysql_upgrade.
mysql-test/extra/binlog_tests/ctype_cp932.test:
Manual merge
mysql-test/r/binlog_row_ctype_cp932.result:
Manual merge
mysql-test/r/binlog_stm_ctype_cp932.result:
Manual merge
mysql-test/r/mysqlbinlog.result:
Manual merge
mysql-test/r/rpl_switch_stm_row_mixed.result:
Manual merge
mysql-test/t/mysqlbinlog.test:
Manual merge
mysql-test/t/rpl_switch_stm_row_mixed.test:
Manual merge
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index cdb75e763b6..444d4112005 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -261,7 +261,9 @@ THD::THD() #endif client_capabilities= 0; // minimalistic client net.last_error[0]=0; // If error on boot +#ifdef HAVE_QUERY_CACHE query_cache_init_query(&net); // If error on boot +#endif ull=0; system_thread= NON_SYSTEM_THREAD; cleanup_done= abort_on_warning= no_warnings_for_error= 0; @@ -1214,7 +1216,7 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange, IO_CACHE *cache) { File file; - uint option= MY_UNPACK_FILENAME; + uint option= MY_UNPACK_FILENAME | MY_RELATIVE_PATH; #ifdef DONT_ALLOW_FULL_LOAD_DATA_PATHS option|= MY_REPLACE_DIR; // Force use of db directory @@ -1228,7 +1230,15 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange, } else (void) fn_format(path, exchange->file_name, mysql_real_data_home, "", option); - + + if (opt_secure_file_priv && + strncmp(opt_secure_file_priv, path, strlen(opt_secure_file_priv))) + { + /* Write only allowed to dir or subdir specified by secure_file_priv */ + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--secure-file-priv"); + return -1; + } + if (!access(path, F_OK)) { my_error(ER_FILE_EXISTS_ERROR, MYF(0), exchange->file_name); |