- 26 Jun, 2006 1 commit
-
-
unknown authored
Bug#19022 "Memory bug when switching db during trigger execution" Bug#17199 "Problem when view calls function from another database." Bug#18444 "Fully qualified stored function names don't work correctly in SELECT statements" Documentation note: this patch introduces a change in behaviour of prepared statements. This patch adds a few new invariants with regard to how THD::db should be used. These invariants should be preserved in future: - one should never refer to THD::db by pointer and always make a deep copy (strmake, strdup) - one should never compare two databases by pointer, but use strncmp or my_strncasecmp - TABLE_LIST object table->db should be always initialized in the parser or by creator of the object. For prepared statements it means that if the current database is changed after a statement is prepared, the database that was current at prepare remains active. This also means that you can not prepare a statement that implicitly refers to the current database if the latter is not set. This is not documented, and therefore needs documentation. This is NOT a change in behavior for almost all SQL statements except: - ALTER TABLE t1 RENAME t2 - OPTIMIZE TABLE t1 - ANALYZE TABLE t1 - TRUNCATE TABLE t1 -- until this patch t1 or t2 could be evaluated at the first execution of prepared statement. CURRENT_DATABASE() still works OK and is evaluated at every execution of prepared statement. Note, that in stored routines this is not an issue as the default database is the database of the stored procedure and "use" statement is prohibited in stored routines. This patch makes obsolete the use of check_db_used (it was never used in the old code too) and all other places that check for table->db and assign it from THD::db if it's NULL, except the parser. How this patch was created: THD::{db,db_length} were replaced with a LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were manually checked and: - if the place uses thd->db by pointer, it was fixed to make a deep copy - if a place compared two db pointers, it was fixed to compare them by value (via strcmp/my_strcasecmp, whatever was approproate) Then this intermediate patch was used to write a smaller patch that does the same thing but without a rename. TODO in 5.1: - remove check_db_used - deploy THD::set_db in mysql_change_db See also comments to individual files. mysql-test/r/create.result: Modify the result file: a database can never be NULL. mysql-test/r/ps.result: Update test results (Bug#17199 et al) mysql-test/r/sp.result: Update test results (Bug#17199 et al) mysql-test/t/create.test: Update the id of the returned error. mysql-test/t/ps.test: Add test coverage for prepared statements and current database. In scope of work on Bug#17199 "Problem when view calls function from another database." mysql-test/t/sp.test: Add a test case for Bug#17199 "Problem when view calls function from another database." and Bug#18444 "Fully qualified stored function names don't work correctly in SELECT statements". Test a complementary problem. sql/item_strfunc.cc: Touch the code that reads thd->db (cleanup). sql/log_event.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/slave.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/slave.h: Remove a declaration for a method that is used only in one module. sql/sp.cc: Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand this function and ensure that it has no bugs. sql/sp.h: Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment. sql/sp_head.cc: - drop sp_name_current_db_new - a creator of sp_name class that was used when sp_name was created for an identifier without an explicitly initialized database. Now we pass thd->db to constructor of sp_name right in the parser. - rewrite sp_head::init_strings: name->m_db is always set now - use the new variant of sp_use_new_db - we don't need to update thd->db with SP MEM_ROOT pointer anymore when parsing a stored procedure, as noone will refer to it (yes!) sql/sp_head.h: - remove unneded methods and members sql/sql_class.h: - introduce 3 THD methods to work with THD::db: .set_db to assign the current database .reset_db to reset the current database (temporarily) or set it to NULL .opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL sql/sql_db.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/sql_insert.cc: - replace checks with asserts: table_list->db must be always set in the parser. sql/sql_lex.h: - add a comment sql/sql_parse.cc: - implement the invariant described in the changeset comment. - remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE: now db_load_routine uses its own LEX object and doesn't damage the main LEX. - add DBUG_ASSERT(0) to unused "check_db_used" sql/sql_table.cc: - replace a check with an assert (table_ident->db) sql/sql_trigger.cc: While we are at it, replace direct access to thd->db with a method. Should simplify future conversion of THD::db to LEX_STRING. sql/sql_udf.cc: - use thd->set_db instead of direct modification of to thd->db sql/sql_view.cc: - replace a check with an assert (view->db) sql/sql_yacc.yy: - make sure that we always copy table->db or name->db or ident->db or select_lex->db from thd->db if the former is not set. If thd->db is not set but is accessed, return an error. sql/tztime.cc: - be nice, never copy thd->db by pointer.
-
- 01 Jun, 2006 15 commits
-
-
unknown authored
-
unknown authored
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
-
unknown authored
into zippy.(none):/home/cmiller/work/mysql/mysql-5.0
-
unknown authored
into shellback.(none):/home/msvensson/mysql/mysql-5.0
-
unknown authored
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
-
unknown authored
into shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
-
unknown authored
-
unknown authored
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
-
unknown authored
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.0
-
unknown authored
into mysql.com:/home/marty/MySQL/mysql-5.0
-
unknown authored
into perch.ndb.mysql.com:/home/jonas/src/50-work ndb/src/kernel/blocks/ERROR_codes.txt: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/test/ndbapi/testNodeRestart.cpp: Auto merged ndb/test/run-test/daily-basic-tests.txt: Auto merged
-
unknown authored
Dont be too aggressive in Dbtc::nodeFailCheckTransaction let it timeout by 1, so that it does not assert that it has waited too long old impl. set timeotu value to 0, making timeout = (ctcTimer - 0) which could be quite big. ndb/src/kernel/blocks/ERROR_codes.txt: error codes ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: 2 new error inserts 7030 - delay in GCP_PREPARE until checkLocalNodefailComplete is true 7031 - delay in GCP_PREPARE and die ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Dont set api con timer to 0, as this might trigger asserion in timeoutfound lab if state == PREPARE_TO_COMMIT ndb/test/ndbapi/testNodeRestart.cpp: testcase ndb/test/run-test/daily-basic-tests.txt: autotest
-
unknown authored
-
unknown authored
-
unknown authored
into rurik.mysql.com:/home/igor/dev/mysql-5.0-0 BitKeeper/deleted/.del-errmsg.txt~31abf77f9e7b9211: Auto merged BitKeeper/deleted/.del-sql_state.h~4307ea5f1fe99019: Auto merged mysql-test/r/explain.result: Auto merged mysql-test/r/key_cache.result: Auto merged mysql-test/r/preload.result: Auto merged mysql-test/t/explain.test: Auto merged mysql-test/t/select.test: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/sql_base.cc: Auto merged BitKeeper/deleted/.del-errmsg.txt~11edc4db89248c16: Manual merge BitKeeper/deleted/.del-errmsg.txt~184eb1f09242dc72: Manual merge BitKeeper/deleted/.del-errmsg.txt~2cdeb8d6f80eba72: Manual merge BitKeeper/deleted/.del-errmsg.txt~4617575065d612b9: Manual merge BitKeeper/deleted/.del-errmsg.txt~587903f9311db2d1: Manual merge BitKeeper/deleted/.del-errmsg.txt~606dfaeb9e81aa4e: Manual merge BitKeeper/deleted/.del-errmsg.txt~6bbd9eac7f0e6b89: Manual merge BitKeeper/deleted/.del-errmsg.txt~7397c423c52c6d2c: Manual merge BitKeeper/deleted/.del-errmsg.txt~898865062c970766: Manual merge BitKeeper/deleted/.del-errmsg.txt~8ed1999cbd481dc4: Manual merge BitKeeper/deleted/.del-errmsg.txt~94a93cc742fca24d: Manual merge BitKeeper/deleted/.del-errmsg.txt~9dab24f7fb11b1e1: Manual merge BitKeeper/deleted/.del-errmsg.txt~b44a85a177954da0: Manual merge BitKeeper/deleted/.del-errmsg.txt~b6181e29d8282b06: Manual merge BitKeeper/deleted/.del-errmsg.txt~ba132dc9bc936c8a: Manual merge BitKeeper/deleted/.del-errmsg.txt~e2609fdf7870795: Manual merge BitKeeper/deleted/.del-errmsg.txt~e3183b99fbba0a9c: Manual merge BitKeeper/deleted/.del-errmsg.txt~eeb2c47537ed9c23: Manual merge BitKeeper/deleted/.del-errmsg.txt~ef28b592c7591b7: Manual merge BitKeeper/deleted/.del-errmsg.txt~ef53c33ac0ff8a84: Manual merge BitKeeper/deleted/.del-errmsg.txt~f19bfd5d4c918964: Manual merge BitKeeper/deleted/.del-errmsg.txt~f96b7055cac394e: Manual merge BitKeeper/deleted/.del-errmsg.txt~ffe4a0c9e3206150: Manual merge BitKeeper/deleted/.del-mysqld_error.h~9dac75782467aab7: Manual merge
-
- 31 May, 2006 14 commits
-
-
unknown authored
into devsrv-b.mysql.com:/users/msvensson/mysql-5.0
-
unknown authored
- avoid allocating memory for each call to 'EVP_md5' and 'EVP_des_ede3_cbc' which were not released until server was stopped - Those functions are used from the SQL function 'des_encrypt' and 'des_decrypt'. extra/yassl/include/openssl/ssl.h: Import patch yassl.diff extra/yassl/include/yassl_int.hpp: Import patch yassl.diff extra/yassl/src/ssl.cpp: Import patch yassl.diff extra/yassl/src/template_instnt.cpp: Import patch yassl.diff extra/yassl/src/yassl_int.cpp: Import patch yassl.diff
-
unknown authored
extra/yassl/src/Makefile.am: Add defined YASSL_PREFIX when building yassl/src extra/yassl/testsuite/Makefile.am: Add defined YASSL_PREFIX when building yassl/testsuite
-
unknown authored
-
unknown authored
extra/yassl/include/openssl/crypto.h: Import patch yassl.diff extra/yassl/include/openssl/ssl.h: Import patch yassl.diff
-
unknown authored
adapting to pushbuild's custom to switch from default pathes. The name for var directory must be set with MYSQLTEST_VARDIR. mysql-test/t/mysqlbinlog.test: correction of log path since pushbuild uses non-default options.
-
unknown authored
into shellback.(none):/home/msvensson/mysql/mysql-5.0 extra/yassl/include/openssl/ssl.h: Auto merged
-
unknown authored
- Part 1, fixes rpl- and federated-tests where connection is made to 127.0.0.1 client/mysqltest.c: Turn on ssl_verify_server_cert only if host is "localhost"
-
unknown authored
- Include prefix files that renames all public functions in yaSSLs OpenSSL API to ya<function_name>. They will otherwise conflict with OpenSSL functions if loaded by an application that uses OpenSSL as well as libmysqlclient with yaSSL support. client/Makefile.am: Remove $yassl_includes ...and one "suspicious line" config/ac-macros/yassl.m4: Remove yassl_includes as they are the same as "normal" include extra/yassl/include/openssl/crypto.h: Add include file "prefix_crypto.h" to rename SSL_* functions to yaSSL_* extra/yassl/include/openssl/ssl.h: Add include file "prefix_crypto.h" to rename SSL_* functions to yaSSL_* libmysql/Makefile.am: Remove yassl_includes libmysql_r/Makefile.am: Remove yassl_includes libmysqld/Makefile.am: Remove yassl_includes And one suspicious line libmysqld/examples/Makefile.am: Remove yassl_includes server-tools/instance-manager/Makefile.am: Remove yassl_includes sql/Makefile.am: Remove yassl_includes tools/Makefile.am: Add link with yaSSL libs vio/Makefile.am: Remove yassl_includes extra/yassl/include/openssl/generate_prefix_files.pl: Add utility script to parse the header files to generate the prefix_* files that renames yaSSL SSL_* functions extra/yassl/include/openssl/prefix_crypto.h: Add prefix file for crypto.h extra/yassl/include/openssl/prefix_ssl.h: Add prefix file for ssl.h
-
unknown authored
into mysql.com:/home/marty/MySQL/mysql-5.0 ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged
-
unknown authored
Two threads both try a shutdown sequence which creates a race to the de-init/free of certain resources. This exists in similar form in the client as 17926: "mysql.exe crashes when ctrl-c is pressed in windows." sql/mysqld.cc: We have three potential ways of hitting the iceberg: - unireg_end() has basic de-init - unireg_abort() has extended de-init - main() has a de-init sequence similar to unireg_abort() In the Windows version of the server, Control-C is handled in a different thread from the one main() is in. The main loop is told to end, then unireg_abort() is called. Its de-init and that of main() will then race each other for mutex- and cond-var-destroys, free(), and finally exit(). This patch introduces a special case for Windows that will eliminate the race by ending the signal-handler via unireg_end() instead if SIGINT is signalled. This seems the least intrusive fix that still fixes user-visible behaviour.
-
unknown authored
missed table to drop after merge from 4.1 mysql-test/r/mysqlbinlog.result: result changed mysql-test/t/mysqlbinlog.test: manual merge post-fix
-
unknown authored
into dl145k.mysql.com:/tmp/andrei/MERGE/5.0 BitKeeper/deleted/.del-config.guess~fd94a91a69a8ce8: Auto merged BitKeeper/deleted/.del-config.sub~d18f703b655db258: Auto merged BitKeeper/deleted/.del-ltmain.sh~9b8b907df176f96e: Auto merged mysql-test/t/mysqlbinlog.test: manual merge, accepting 4.1 mods sql/sql_class.cc: use local, Ramil explained it's a backport
-
unknown authored
into shellback.(none):/home/msvensson/mysql/mysql-5.0
-
- 30 May, 2006 9 commits
-
-
unknown authored
into mysql.com:/space/pekka/ndb/version/my50
-
unknown authored
into mysql.com:/mnt/storeage/mysql-5.0-maint_bug18669 sql/sql_parse.cc: Auto merged
-
unknown authored
into mysql.com:/usr/home/ram/work/mysql-5.0
-
unknown authored
into mysql.com:/home/alik/MySQL/devel/5.0-tree
-
unknown authored
into mysql.com:/usr/home/ram/work/mysql-5.0 client/mysqlbinlog.cc: merge
-
unknown authored
into rurik.mysql.com:/home/igor/mysql-4.1
-
unknown authored
refers to a column name. mysql-test/r/select.result: Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX refers to a column name. Added a new test case. mysql-test/t/select.test: Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX refers to a column name. Added a new test case. sql/share/czech/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/danish/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/dutch/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/english/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/estonian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/french/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/german/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/greek/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead.\ sql/share/hungarian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/italian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/japanese-sjis/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead.\ sql/share/japanese/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/korean/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/norwegian-ny/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/norwegian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/polish/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/portuguese/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/romanian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/russian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/serbian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/slovak/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/spanish/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/swedish/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead. sql/share/ukrainian/errmsg.txt: Removed error message ER_INDEX_DOES_NOT_EXIST, used ER_KEY_DOES_NOT_EXITS instead.
-
unknown authored
Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views" This bug caused crashes or resulted in wrong data being returned when one tried to obtain information from I_S tables about views using stored functions. It was caused by the fact that we were using LEX representing statement which were doing select from I_S tables as active LEX when contents of I_S table were built. So state of this LEX both affected and was affected by open_tables() calls which happened during this process. This resulted in wrong behavior and in violations of some of invariants which caused crashes. This fix tries to solve this problem by properly saving/resetting and restoring part of LEX which affects and is affected by the process of opening tables and views in get_all_tables() routine. To simplify things we separated this part of LEX in a new class and made LEX its descendant. mysql-test/r/information_schema_db.result: test case mysql-test/t/information_schema_db.test: test case sql/sql_lex.cc: To simplify saving/resetting and restoring part of LEX which affects and is affected by the process of opening tables and views we moved it to new class Query_tables_list and made LEX descendant of this class. Also introduced two LEX methods which can be used to save and reset or to restore this state. sql/sql_lex.h: To simplify saving/resetting and restoring part of LEX which affects and is affected by the process of opening tables and views we moved it to new class Query_tables_list and made LEX descendant of this class. Also introduced two LEX methods which can be used to save and reset or to restore this state. sql/sql_show.cc: Now in get_all_tables() routine we properly save/reset and restore part of LEX (statement table list and information about routines used) which affects and is affected by the process of opening tables and views. sql/sql_table.cc: Now we clean-up LEX after opening table (view) in two stages. In the first stage we call LEX::cleanup_after_one_table_open() to clean-up selects lists and derived tables state. In the second stage which happens after close_thread_tables() is invoked we call Query_tables_list::reset_query_tables_list(FALSE) to rollback changes in Query_tables_list.
-
unknown authored
into mysql.com:/space/pekka/ndb/version/my50
-
- 29 May, 2006 1 commit
-
-
unknown authored
-