Commit graph

37264 commits

Author SHA1 Message Date
unknown
be7b4043b9 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-07-21 17:52:16 +04:00
unknown
d758b1e629 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29898-bug-5.0-opt-mysql
2007-07-20 22:05:20 +04:00
unknown
7a99db0b73 Remove obvious comments. 2007-07-20 19:46:13 +04:00
unknown
db31d3c96d Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-07-20 04:15:50 +05:00
unknown
a131428f04 Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
The Item_date_typecast::val_int function doesn't reset null_value flag.
This makes all values that follows the first null value to be treated as nulls
and led to a wrong result.

Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.


mysql-test/t/cast.test:
  Added a test case for the bug#29898:  Item_date_typecast::val_int doesn't reset
  the null_value flag.
mysql-test/r/cast.result:
  Added a test case for the bug#29898:  Item_date_typecast::val_int doesn't reset
  the null_value flag.
sql/item_timefunc.cc:
  Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
  Now the Item_date_typecast::val_int function correctly sets the null_value flag
  for both null and non-null values.
2007-07-20 00:06:35 +04:00
unknown
d0020607b3 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29850-bug-5.0-opt-mysql
2007-07-19 21:40:12 +04:00
unknown
7f6a816484 Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs
a temporary table.

The result string of the Item_func_group_concat wasn't initialized in the 
copying constructor of the Item_func_group_concat class. This led to a
wrong charset of GROUP_CONCAT result when the select employs a temporary
table.

The copying constructor of the Item_func_group_concat class now correctly
initializes the charset of the result string.


mysql-test/t/func_gconcat.test:
  Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
  when the select employs a temporary table.
mysql-test/r/func_gconcat.result:
  Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
  when the select employs a temporary table.
sql/item_sum.cc:
  Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs
  a temporary table.
  The copying constructor of the Item_func_group_concat class now correctly
  initializes the charset of the result string.
2007-07-19 20:21:23 +04:00
unknown
248c5e24e9 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/29687/my50-29687
2007-07-19 21:01:58 +05:00
unknown
0299963601 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/29687/my50-29687
2007-07-19 20:59:08 +05:00
unknown
8d592e95a5 Merge bk-internal.mysql.com:/data0/bk/mysql-4.1-maint
into  bk-internal.mysql.com:/data0/bk/tsmith-tmp/mysql-5.0-maint
2007-07-19 17:43:34 +02:00
unknown
62eb5f1794 Rename all references to 'Delayed_insert' instances from 'tmp' to 'di'
for consistency.
2007-07-19 19:36:52 +04:00
unknown
e81e55e783 A fix for Bug#29431 killing an insert delayed thread causes crash
No test case, since the bug requires a stress case with 30 INSERT DELAYED
threads and 1 killer thread to repeat. The patch is verified
manually.
Review fixes.

The server that is running DELAYED inserts would deadlock itself
or crash under high load if some of the delayed threads were KILLed
in the meanwhile.

The fix is to change internal lock acquisition order of delayed inserts
subsystem and to ensure that
Delayed_insert::table_list::db does not point to volatile memory in some 
cases.
For details, please see a comment for sql_insert.cc.


sql/sql_insert.cc:
  A fix for Bug#29431 killing an insert delayed thread causes crash
  
  1) The deadlock was caused by different lock acquisition order
  between delayed_get_table and handle_delayed_insert.
  
  delayed_get_table would:
  - acquire LOCK_delayed_create
  - create a new Delayed_insert instance
  - acquire instance mutex (di->mutex)
  - "lock the instance in memory" by 
  increasing di->locked_in_memory variable
  - start the delayed thread
  - release di->mutex
  - let the delayed thread open the delayed table
  - discover that the delayed thread was killed
  - try to unlock() the delayed insert instance in memory
  - in Delayed_insert::unlock() do
   * lock LOCK_delayed_insert
   * decrease locks_in_memory and discover it's 0
   * attempt to lock di->mutex to broadcast di->cond condition <-- deadlock
   here
  
  Meanwhile, the delayed thread would
   * lock di->mutex
   * open the table
   * get killed
   * not notice that and attempt to lock LOCK_delayed_insert
  to register itself in the delayed insert list <-- deadlock here.
  
  Simply put, delayed_get_table used to lock LOCK_delayed_insert and then 
  di->mutex, and handle_delayed_insert would lock di->mutex and then 
  LOCK_delayed_insert.
  
  Fixed by moving registration in the list of delayed insert threads from 
  handle_delayed_insert to delayed_get_table - so that now
  handle_delayed_insert doesn't need to acquire LOCK_delayed_insert mutex.
  
  
  2) di->table_list.db was copied by-pointer from table_list.db of the first
  producer -- the one who initiated creation of the delayed insert thread.
  This producer might be long gone when the member is needed
  (handle_delayed_insert:open_ltable),
  e.g. by having been killed with KILL CONNECTION statement.
  Fixed by using a pointer to the consumer's deep copy of THD::db.
  
  3) In find_handler, we shouldn't assume that Delayed_insert object
  already (or still) has a table opened all the time it is
  present in the delayed insert list. E.g. it's not the case
  when Delayed_insert decided to terminate, closed the table, but haven't
  yet unregistered from the list (see the end of handle_delayed_insert).
2007-07-19 19:28:00 +04:00
unknown
c865b22514 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/ha_myisam.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-07-19 19:57:53 +05:00
unknown
8b59beaebe Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28524
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-19 10:54:39 +05:00
unknown
2bfe84d434 Fixed bug #28524.
For each view the mysqldump utility creates a temporary table
with the same name and the same columns as the view 
in order to satisfy views that depend on this view.
After the creation of all tables, mysqldump drops all
temporary tables and creates actual views.
However, --skip-add-drop-table and --compact flags disable
DROP TABLE statements for those temporary tables. Thus, it was
impossible to create the views because of existence of the
temporary tables with the same names.


client/mysqldump.c:
  Fixed bug #28524.
  The mysqldump utility has been modified to unconditionally drop
  temporary tables before the creation of views.
mysql-test/t/mysqldump.test:
  Updated test case for bug #28524 and updated result of previous tests.
mysql-test/r/mysqldump.result:
  Updated test case for bug #28524 and updated result of previous tests.
2007-07-18 19:14:48 +05:00
unknown
6981af6ff5 Add a test case for Bug#22427 create table if not exists + stored
function results in inconsistent behavior.

The bug itself was fixed by the patch for bug 20662.


mysql-test/r/sp-prelocking.result:
  Update results (Bug#22427)
mysql-test/t/sp-prelocking.test:
  Add a test case for Bug#22427 create table if not exists + stored 
  function results in inconsistent behavior
2007-07-18 17:09:03 +04:00
unknown
a266c16d14 Bug #29325: create table overwrites .MYD file of other
table (datadir)
Set errno when retunring an error in my_create_with_symlink.


mysys/my_symlink2.c:
  Bug #29325: set errno when retunring 
  an error in my_create_with_symlink
2007-07-18 15:33:41 +03:00
unknown
c0277a1192 A fix and a test case for Bug#26104 Bug on foreign key class constructor.
Fix the typo in the constructor. Cover a semantic check that previously
never worked with a test.


mysql-test/r/create.result:
  Update results (Bug#26104)
mysql-test/r/innodb.result:
  Update results.
mysql-test/t/create.test:
  Add a test case for Bug#26104 Bug on foreign key class constructor
mysql-test/t/innodb.test:
  Return a new error number (MySQL error instead of internal InnoDB error).
sql/sql_class.h:
  A fix for Bug#26104 Bug on foreign key class constructor -- fix
  the typo in the constructor
2007-07-18 16:22:05 +04:00
unknown
5f462f9626 Add a test case for Bug#27248 Triggers: error if insert affects temporary
table.
The bug itself is yet another manifestation of Bug 26141.


mysql-test/r/trigger.result:
  Update results.
mysql-test/t/trigger.test:
  Add a test case for Bug#27248 Triggers: error if insert affects temporary
  table
2007-07-18 14:42:06 +04:00
unknown
06b446dae4 Mark deadcode for gcov 2007-07-18 11:12:15 +04:00
unknown
043f697aee Mark deadcode for gcov 2007-07-18 00:29:25 +04:00
unknown
2679e53a73 Small comments fix 2007-07-17 22:46:51 +04:00
unknown
91301448e9 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


sql/mysql_priv.h:
  Auto merged
2007-07-17 11:32:50 -06:00
unknown
c20595d8a0 Merge ramayana.hindu.god:/home/tsmith/m/bk/41
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/41
2007-07-17 11:32:34 -06:00
unknown
ded5009aaf Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug29740
2007-07-17 19:53:33 +04:00
unknown
955c19961d [pb problem]: ha_heap->clone() fails on windows because of mess with
'/' and '\' in path delimiters:
- Fix this by creating new handler with exactly the same path line as
  was passed to ha_create/ha_open.


sql/opt_range.cc:
  Set thd->net.report_error on handler::clone() failure
2007-07-17 19:51:50 +04:00
unknown
cff1088d03 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-07-17 13:08:23 +04:00
unknown
60e70c6920 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  sin.intern.azundris.com:/home/tnurnberg/27198/50-27198
2007-07-17 09:37:46 +02:00
unknown
7858729d94 Merge sin.intern.azundris.com:/home/tnurnberg/27198/41-27198
into  sin.intern.azundris.com:/home/tnurnberg/27198/50-27198


sql/mysql_priv.h:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-07-17 06:59:24 +02:00
unknown
e587830c50 Merge sin.intern.azundris.com:/home/tnurnberg/27198/40-27198
into  sin.intern.azundris.com:/home/tnurnberg/27198/41-27198


sql/mysql_priv.h:
  Bug #27198: Error returns from time() are ignored
  
  manual merge
sql/sql_class.h:
  Bug #27198: Error returns from time() are ignored
  
  manual merge
2007-07-16 22:38:50 +02:00
unknown
b94fb82847 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime


mysql-test/t/sp.test:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Manual merge.
mysql-test/t/innodb_mysql.test:
  Manual merge.
2007-07-16 23:41:28 +04:00
unknown
de2089264f Bug#29050 Creation of a legal stored procedure fails if a database is not
selected prior: ensure the fix also works for information_schema
tables.


sql/sql_parse.cc:
  Ensure the fix for Bug#29050 works for information_schema tables.
2007-07-16 23:37:02 +04:00
unknown
7dc853561c Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg
2007-07-16 20:39:05 +02:00
unknown
9917ce268d Bug #29687 mysql_stmt_store_result memory leak in libmysqld
In embedded server we use result->alloc to store field data for the
result, but we didn't clean the result->alloc if the query returned
an empty recordset. Cleaning for the empty recordset enabled


libmysql/libmysql.c:
  Bug #29687 mysql_stmt_store_result memory leak in libmysqld
  
  we should clean result->alloc even if we have nothin in 'data' field
2007-07-16 19:08:07 +05:00
unknown
7d3cecca0a Raise version number after cloning 5.0.46 2007-07-16 12:42:12 +02:00
unknown
56a65d7ad0 item_cmpfunc.cc:
A typo fixed.


sql/item_cmpfunc.cc:
  A typo fixed.
2007-07-16 01:03:58 +04:00
unknown
3e925554ec item_cmpfunc.cc:
Fixed compiler warning.


sql/item_cmpfunc.cc:
  Fixed compiler warning.
2007-07-16 00:59:47 +04:00
unknown
16135c7dca item_cmpfunc.cc:
A comment changed.


sql/item_cmpfunc.cc:
  A comment changed.
2007-07-15 23:40:57 +04:00
unknown
6e078ff543 Extended fix for the bug#29555.
The get_time_value function is added. It is used to obtain TIME values both
from items the can return time as an integer and from items that can return
time only as a string.
The Arg_comparator::compare_datetime function now uses pointer to a getter
function to obtain values to compare. Now this function is also used for
comparison of TIME values.
The get_value_func variable is added to the Arg_comparator class.
It points to a getter function for the DATE/DATETIME/TIME comparator.


mysql-test/t/type_time.test:
  Extended test case for the bug#29555.
mysql-test/r/type_time.result:
  Extended test case for the bug#29555.
sql/item_cmpfunc.cc:
  Extended fix for the bug#29555.
  The get_time_value function is added. It is used to obtain TIME values both
  from items the can return time as an integer and from items that can return
  time only as a string.
  The Arg_comparator::compare_datetime function now uses pointer to a getter
  function to obtain values to compare. Now this function is also used for
  comparison of TIME values.
sql/item_cmpfunc.h:
  Extended fix for the bug#29555.
  The get_value_func variable is added to the Arg_comparator class.
  It points to a getter function for the DATE/DATETIME/TIME comparator.
2007-07-15 21:51:36 +04:00
unknown
8023d91929 Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in
Linux Debug build (possible deadlock)"

The bug is not repeatable any more.


mysql-test/r/innodb_mysql.result:
  Update test results (Bug#27296)
mysql-test/t/innodb_mysql.test:
  Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in 
  Linux Debug build (possible deadlock)"
2007-07-15 13:34:35 +04:00
unknown
4b7e6a3842 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29729-bug-5.0-opt-mysql
2007-07-14 23:30:07 +04:00
unknown
4f146f656c Bug#29729: Wrong conversion error led to an empty result set.
The Field_newdate::store when storing a DATETIME value was returning the
'value was cut' error even if the thd->count_cuted_fields flag is set to
CHECK_FIELD_IGNORE. This made range optimizr think that there is no
appropriate data in the table and thus to return an empty set.

Now the Field_newdate::store function returns conversion error only if the
thd->count_cuted_fields flag isn't set to CHECK_FIELD_IGNORE.


mysql-test/t/type_time.test:
  Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
mysql-test/r/type_time.result:
  Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
sql/field.cc:
  Bug#29729: Wrong conversion error led to an empty result set.
2007-07-14 22:43:58 +04:00
unknown
25545b4bfb BUG#29740: Make the test result deterministic 2007-07-14 22:02:10 +04:00
unknown
a90ccb1bae Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug29740
2007-07-14 20:31:59 +04:00
unknown
bf78cb1e6e Merge chilla.local:/home/mydev/mysql-4.1-axmrg
into  chilla.local:/home/mydev/mysql-5.0-axmrg
2007-07-14 17:51:52 +02:00
unknown
15070b3a55 Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg
2007-07-14 17:51:00 +02:00
unknown
26b8578fa9 Merge chilla.local:/home/mydev/mysql-4.1-amain
into  chilla.local:/home/mydev/mysql-4.1-axmrg
2007-07-14 16:19:17 +02:00
unknown
a9c6a0bbbc BUG#29734 - thread_id=0 in binary log which leads to temporary table conflicts
pseudo_thread_id was reset to zero via mysql_change_user() handling
whereas there is no reason to do that.  Moreover, having two
concurrent threads that change user and create a namesake temp tables
leads to recording the dup pair of queries:

   set @@session.pseudo_thread_id = 0;
   CREATE temporary table `the namesake`;

which will stall the slave as the second instance can not be created.
And that is the bug case.

Fixed by correcting pseudo_thread_id value after mysql_change_user().


sql/sql_class.cc:
  Fixed that pseudo_thread_id was set to 0 after mysql_change_user().
2007-07-14 17:58:39 +05:00
unknown
8c56d8e89c Merge olga.mysql.com:/home/igor/mysql-5.0-rpl
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-merge
2007-07-13 19:05:30 -07:00
unknown
a7e5f73abb Bug#27198: Error returns from time() are ignored
gettimeofday() can fail and presumably, so can time().
Keep an eye on it.

Since we have no data on this at all so far, we just
retry on failure (and log the event), assuming that
this is just an intermittant failure. This might of
course hang the threat until we succeed. Once we know
more about these failures, an appropriate more clever
scheme may be picked (only try so many times per thread,
etc., if that fails, return last "good" time() we got or
some such).  Using sql_print_information() to log as this
probably only occurs in high load scenarios where the debug-
trace likely is disabled (or might interfere with testing
the effect).  No test-case as this is a non-deterministic
issue.


sql/mysql_priv.h:
  Bug#27198: Error returns from time() are ignored
  
  move declarations for log.cc to before inclusion of
  sql_class.h as we now use sql_print_information() in
  there.
sql/sql_class.h:
  Bug#27198: Error returns from time() are ignored
  
  gettimeofday() can fail and presumably, so can time().
  Keep an eye on it.
2007-07-13 17:50:58 +02:00