Commit graph

583 commits

Author SHA1 Message Date
kostja@bodhi.local
04c97488f9 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
2006-08-12 21:06:51 +04:00
kostja@bodhi.local
4bfc67fc3c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
2006-08-02 14:13:01 +04:00
grog@eucla.lemis.com
f50d4caa95 slave.cc:
BUG#20850: Assert during slave shutdown in many rpl_* tests
      This patch has already been applied to 5.1.
2006-07-25 20:00:18 +09:30
kostja@bodhi.local
2ce1a07c89 A fix and a test case for Bug#15752 "Lost connection to MySQL server
when calling a SP from C API"

The bug was caused by lack of checks for misuse in mysql_real_query. 
A stored procedure always returns at least one result, which is the 
status of execution of the procedure itself.
This result, or so-called OK packet, is similar to a result
returned by INSERT/UPDATE/CREATE operations: it contains the overall
status of execution, the number of affected rows and the number of
warnings. The client test program attached to the bug did not read this 
result and ivnoked the next query. In turn, libmysql had no check for 
such scenario and mysql_real_query was simply trying to send that query 
without reading the pending response, thus messing up the communication
protocol.

The fix is to return an error from mysql_real_query when it's called
prior to retrieval of all pending results.
2006-07-24 14:56:53 +04:00
mats@romeo.(none)
4044fb8cc7 Bug#20850 (Assert during slave shutdown in many rpl_* tests):
Previous patch didn't work: moving variable settings inside critical region.
2006-07-07 18:31:00 +02:00
grog@eucla.lemis.com
8710951295 slave.cc:
BUG#20850: Assert during slave shutdown in many rpl_* tests.
  This was caused by a race condition at the end of handle_slave_io
  which under some circumstances allowed the cleanup to proceed before
  the thread had completed.
2006-07-07 17:18:52 +09:30
grog@eucla.lemis.com
1afe620116 slave.cc:
Tidy up white space.
2006-07-07 16:57:55 +09:30
konstantin@mysql.com
55d148c5c2 A fix for Bug#19022 "Memory bug when switching db during trigger execution".
No test case as the bug is in an existing test case (rpl_trigger.test
when it is run under valgrind).
The warning was caused by memory corruption in replication slave: thd->db
was pointing at a stack address that was previously used by 
sp_head::execute()::old_db. This happened because mysql_change_db
behaved differently in replication slave and did not make a copy of the 
argument to assign to thd->db. 
The solution is to always free the old value of thd->db and allocate a new
copy, regardless whether we're running in a replication slave or not.
2006-06-28 23:47:45 +04:00
konstantin@mysql.com
e29ea3f2ef Fix yet another place that used uint32 instead of uint. 2006-06-27 17:34:14 +04:00
konstantin@mysql.com
4d25d2154c Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/opt/local/work/mysql-5.0-17199
2006-06-27 00:52:56 +04:00
konstantin@mysql.com
117b76a562 A fix and a test case for
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.
2006-06-27 00:47:52 +04:00
elliot@mysql.com
bc2b96fee3 Merge mysql.com:/home/emurphy/src/bk-clean/tmp_merge
into  mysql.com:/home/emurphy/src/bk-clean/mysql-5.1
2006-06-25 09:59:34 -04:00
mats@mysql.com
e57e87980b Bug#19437 (Connection refused by server: "2002 Can't connect... /master.sock"):
Clearing active VIO before calling mysql_close() in the slave I/O
thread.
2006-06-20 20:46:45 +02:00
petr@outpost.site
86420b38aa Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/home/cps/mysql/devel/5.1-csv-remove-mmap
2006-06-15 15:38:14 +04:00
serg@sergbook.mysql.com
9eb15a0e8f sql/Makefile.am: better mysqld dependencies
sql/discover.cc:    close(-1) bug
sql/slave.cc:       DBUG_ENTER/RETURN tags
ha_archive.cc:      double-close bug
2006-05-30 18:21:03 +02:00
msvensson@neptunus.(none)
f25fcf79a5 Bug#19938 Valgrind error (race) in handle_slave_sql() 2006-05-23 20:16:57 +02:00
msvensson@neptunus.(none)
6fb8f4f878 Bug #19938 Valgrind error (race) in handle_slave_sql() 2006-05-23 16:20:03 +02:00
msvensson@neptunus.(none)
ebedae2cb3 Cset exclude: msvensson@neptunus.(none)|ChangeSet|20060523082057|49143 2006-05-23 16:14:48 +02:00
msvensson@neptunus.(none)
26face9f8b Bug#19938 Valgrind error (race) in handle_slave_sql()
- Unlock the mutex after looking at rli->events_till_abort
 - Already fixed in 5.1 so it will be null merged.
2006-05-23 10:20:57 +02:00
petr@mysql.com
fec70c97c9 WL#3153 "Split logs". Recommit with post-review fixes 2006-05-05 10:45:58 +04:00
brian@zim.(none)
5d1d27c016 Final patch to remove the last of the OS2 support. 2006-04-15 18:17:32 -07:00
monty@mysql.com
1994ed49ec Fixed compiler and valgrind warnings
Added missing DBUG_xxx_RETURN statements
Fixed some usage of not initialized variables (as found by valgrind)
Ensure that we don't remove locked tables used as name locks from open table cache until unlock_table_names() are called.
This was fixed by having drop_locked_name() returning any table used as a name lock so that we can free it in unlock_table_names()
This will allow Tomas to continue with his work to use namelocks to syncronize things.

Note: valgrind still produces a lot of warnings about using not initialized code and shows memory loss errors when running the ndb tests
2006-03-29 14:27:36 +03:00
mats@mysql.com
9fb1e542fb Merge mysql.com:/home/bkroot/mysql-5.1-wl3023
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-03-08 14:22:04 +01:00
mats@mysql.com
e824e61618 Bug#16228 (RBR: Slave SQL thread retries infinitely):
Transaction aborted on slave should be retries. The OPTION_BEGIN
  bit was cleared prematurely. Removed dependence of code on value
  of OPTION_BEGIN bit when executing retries.
2006-03-07 13:29:53 +01:00
mats@mysql.com
0ffd1be87d WL#3023 (RBR: Use locks in a statement-like manner):
More adaptions to make it work with existing code base.
2006-03-03 09:49:46 +01:00
mats@mysql.com
13a61982a9 Merge mysqldev@production.mysql.com:my/mysql-5.1-release
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-02-24 16:31:38 +01:00
holyfoot@mysql.com
be02944df6 Merging 5.0->5.1 2006-02-17 11:26:03 +04:00
holyfoot@deer.(none)
053d90a234 WL#2645 (CHECK TABLE FOR UPGRADE)
necessary implementation in the server
mysql_upgrade script added
2006-02-17 10:52:32 +04:00
mats@mysql.com
43bc3c4068 Merge mysql.com:/home/bkroot/mysql-5.1-new
into  mysql.com:/home/bk/w3023-mysql-5.1-new
2006-02-16 08:46:45 +01:00
mats@mysql.com
2884408c75 WL#3023 (Use locks in a statement-like manner):
Table maps are now written on aquiring locks to tables and released
  at the end of each logical statement.
2006-02-16 08:30:53 +01:00
serg@serg.mylan
63cfd11859 dbug changes:
1. dbug state is now local to a thread
2. new macros: DBUG_EXPLAIN, DBUG_EXPLAIN_INITIAL,
   DBUG_SET, DBUG_SET_INITIAL, DBUG_EVALUATE, DBUG_EVALUATE_IF
3. macros are do{}while(0) wrapped
4. incremental modifications to the dbug state (e.g. "+d,info:-t")
5. dbug code cleanup, style fixes
6. _db_on_ and DEBUGGER_ON/OFF removed
7. rest of MySQL code fixed because of 3 (missing ;) and 6
8. dbug manual updated
9. server variable @@debug (global and local) to control dbug from SQL!
a. -#T to print timestamps in the log
2006-02-14 22:36:11 +01:00
konstantin@mysql.com
92b41ba92a Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge
2006-02-02 16:57:34 +03:00
cps@outpost.site
ce2eb6d8cb WL1019: complete patch. Reapplied patch to the clean
tree to get rid of multiple typos in CS comments and
unify the patch.
2006-01-19 05:56:06 +03:00
tomas@poseidon.ndb.mysql.com
4b731ddfb4 wl2325 wl2324 2006-01-12 19:51:02 +01:00
serg@serg.mylan
14f94dc0ca many warnings (practically safe but annoying) corrected 2006-01-03 17:54:54 +01:00
lars@mysql.com
ad126d90e0 WL#1012: All changes as one single changeset.
This includes both code and test cases.
2005-12-22 06:39:02 +01:00
monty@mysql.com
a3436bd7de Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1-TDC
2005-11-24 04:08:07 +02:00
monty@mysql.com
aa37b75768 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2005-11-24 02:56:12 +02:00
monty@mysql.com
4575a662cb Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1-TDC
2005-11-23 22:58:53 +02:00
monty@mysql.com
e42c980967 Table definition cache, part 2
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
  object and open a handler to the table object

Other noteworthy changes:
- In TABLE_SHARE the most common strings are now LEX_STRING's
- Better error message when table is not found
- Variable table_cache is now renamed 'table_open_cache'
- New variable 'table_definition_cache' that is the number of table defintions that will be cached
- strxnmov() calls are now fixed to avoid overflows
- strxnmov() will now always add one end \0 to result
- engine objects are now created with a TABLE_SHARE object instead of a TABLE object.
- After creating a field object one must call field->init(table) before using it

- For a busy system this change will give you:
 - Less memory usage for table object
 - Faster opening of tables (if it's has been in use or is in table definition cache)
 - Allow you to cache many table definitions objects
 - Faster drop of table
2005-11-23 22:45:02 +02:00
konstantin@mysql.com
b1d951d462 Always initialize THD::thread_stack: it's used in
check_stack_overrun().
2005-11-23 21:18:10 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
5273071265 Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new
2005-11-23 14:57:00 +02:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
monty@mysql.com
a6f5375cb0 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
2005-11-05 01:32:55 +02:00
SergeyV@selena.
77dc254958 Fix for the patch #13377. Avoids race condition for relay logs close.
Code that closes current relay log is moved to purge_relay_logs().
2005-10-27 17:04:01 +04:00
sergefp@mysql.com
e7065d355c BUG#121915: Merge 4.1->5.0 2005-10-19 01:52:06 +04:00
SergeyV@selena.
3dec6a3b14 Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-5.0
into  selena.:H:/MYSQL/src/#13377-mysql-5.0
2005-10-17 19:09:12 +04:00
guilhem@mysql.com
845b9fbf58 fix for Valgrind errors: query_id needs to be inited early (already fixed in 5.0 by Konstantin) and so does client_capabilities (not fixed in 5.0);
because they are used by net_printf() and push_warning(), which can be called if check_connection() fails.
2005-10-14 15:34:52 +02:00
monty@mysql.com
6f5baa1eba Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-10-13 20:18:37 +03:00
monty@mysql.com
829a4831b1 Fixes during review of new code 2005-10-13 19:24:01 +03:00