Commit graph

40453 commits

Author SHA1 Message Date
Joerg Bruehe
72da6b3185 Bug#50950 Obsolete reference to www.mysql.com
in message printed at end of configure

New text for the success message of "configure".

configure.in:
  The message must be changed to drop the "www.mysql.com" URL.
2010-02-08 21:10:37 +01:00
Georgi Kodinov
b8db15fc22 tree name change 2010-02-04 12:13:29 +02:00
MySQL Build Team
dcd563786c Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2840 [merge]
> revision-id: ramil@mysql.com-20100113101142-pda4phrsyh1rjp85
> parent: joerg@mysql.com-20100112114118-zfpofgcu0j49j839
> parent: ramil@mysql.com-20100113052045-een35iazzk8023w2
> committer: Ramil Kalimullin <ramil@mysql.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Wed 2010-01-13 14:11:42 +0400
> message:
>   Auto-merge.
> ------------------------------------------------------------
> Use --include-merges or -n0 to see merged revisions.
2010-02-03 16:43:18 +01:00
MySQL Build Team
ce730c3d33 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.48
> revision-id: joro@sun.com-20091210092838-zbz9ugqay1tn7rxm
> parent: joro@sun.com-20091207143856-ojmmqr0bm1haxvca
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B49250-5.0-bugteaam
> timestamp: Thu 2009-12-10 11:28:38 +0200
> message:
>   Bug #49250 : spatial btree index corruption and crash
>   
>   SPATIAL and FULLTEXT indexes don't support algorithm
>   selection. 
>   Disabled by creating a special grammar rule for these
>   in the parser.
>   Added some encasulation of duplicate parser code.
2010-02-03 16:42:25 +01:00
MySQL Build Team
318e49ab26 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.41 [merge]
> revision-id: epotemkin@mysql.com-20091203132153-k8xwk3nh02n8npg4
> parent: epotemkin@mysql.com-20091202134712-4muwnr152xqkcwm7
> parent: epotemkin@mysql.com-20091203131520-93uiop1a81o9z8mb
> committer: Evgeny Potemkin <epotemkin@mysql.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Thu 2009-12-03 16:21:53 +0300
> message:
>   Auto-merged.
> ------------------------------------------------------------
> Use --include-merges or -n0 to see merged revisions.
2010-02-03 16:41:24 +01:00
MySQL Build Team
5eebf7a951 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.40 [merge]
> revision-id: epotemkin@mysql.com-20091202134712-4muwnr152xqkcwm7
> parent: gshchepa@mysql.com-20091201102444-yw166t3audrojo9s
> parent: epotemkin@mysql.com-20091201182845-aw0uawt6c6gwi98c
> committer: Evgeny Potemkin <epotemkin@mysql.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Wed 2009-12-02 16:47:12 +0300
> message:
>   Auto-merged fix for the bug#48508.
> ------------------------------------------------------------
> Use --include-merges or -n0 to see merged revisions.
2010-02-03 16:40:24 +01:00
MySQL Build Team
6ed87929ab Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.39
> revision-id: gshchepa@mysql.com-20091201102444-yw166t3audrojo9s
> parent: joro@sun.com-20091127160731-6h2fahbh4409i841
> committer: Gleb Shchepa <gshchepa@mysql.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Tue 2009-12-01 14:24:44 +0400
> message:
>   Bug #38883 (reopened): thd_security_context is not thread safe, crashes?
>   
>   The bug 38816 changed the lock that protects THD::query from
>   LOCK_thread_count to LOCK_thd_data, but didn't update the associated
>   InnoDB functions.
>   
>   1. The innobase_mysql_prepare_print_arbitrary_thd and the
>   innobase_mysql_end_print_arbitrary_thd InnoDB functions have been
>   removed, since now we have a per-thread mutex: now we don't need to wrap
>   several inter-thread access tries to THD::query with a single global
>   LOCK_thread_count lock, so we can simplify the code.
>   
>   2. The innobase_mysql_print_thd function has been modified to lock
>   LOCK_thd_data in direct way.
2010-02-03 16:38:46 +01:00
MySQL Build Team
1bd8b8676a Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.38
> revision-id: joro@sun.com-20091127160731-6h2fahbh4409i841
> parent: joro@sun.com-20091127143622-bqfsmhhr2pqodsm2
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: fix-5.0-bugteam
> timestamp: Fri 2009-11-27 18:07:31 +0200
> message:
>   Addendum to bug #48872: disable output in the test case because errors are 
>   dependent on the case mode
2010-02-03 16:37:47 +01:00
MySQL Build Team
9978defd25 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.35
> revision-id: joro@sun.com-20091127095944-autr58itccge4z9l
> parent: satya.bn@sun.com-20091125095925-871384fcnwwa2yqt
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B48872-5.0-bugteam
> timestamp: Fri 2009-11-27 11:59:44 +0200
> message:
>   Bug #48872 : Privileges for stored functions ignored if function name
>     is mixed case
>   
>   Transcode the procedure name to lowercase when searching for it in the 
>   hash. This is the missing part of the fix for bug #41049.
2010-02-03 16:36:20 +01:00
MySQL Build Team
f5110c0f73 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.29
> revision-id: joro@sun.com-20091118152410-j4tv22vf9xkb6sdz
> parent: kent.boortz@sun.com-20091117164924-rscth12t9a2qog1b
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: test-5.0-bugteam
> timestamp: Wed 2009-11-18 17:24:10 +0200
> message:
>   Bug#48864: MySQL fails to compile on 64 bit Fedora 12
>   
>   Fixed 2 errors in comp_err executable : 
>   1. Wrong (off by 1) length passed to my_checksum()
>   2. strmov() was used on overlapping strings. This is
>    not legal according to the docs in stpcpy(). Used 
>   the overlap safe memmove() instead.
2010-02-03 16:34:46 +01:00
MySQL Build Team
a800d18bca Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.26
> revision-id: joro@sun.com-20091109140946-07wao5od7l1vn4x1
> parent: joro@sun.com-20091110082141-ldr8p6s1joczve2j
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B48458-5.0-bugteam
> timestamp: Mon 2009-11-09 16:09:46 +0200
> message:
>   Bug #48458: simple query tries to allocate enormous amount of
>     memory
>   
>   The server was doing a bad class typecast causing setting of 
>   wrong value for the maximum number of items in an internal
>   structure used in equality propagation.
>   Fixed by not doing the wrong typecast and asserting the type
>   of the Item where it should be done.
2010-02-03 16:33:14 +01:00
MySQL Build Team
fe1d197a5b Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.19
> revision-id: kostja@sun.com-20091103165854-7di545xruez8w207
> parent: li-bing.song@sun.com-20091103090041-zj7nedx6ok5jgges
> committer: Konstantin Osipov <kostja@sun.com>
> branch nick: 5.0-41756
> timestamp: Tue 2009-11-03 19:58:54 +0300
> message:
>   A fix and a test case for
>   Bug#41756 "Strange error messages about locks from InnoDB".
>   
>   In JT_EQ_REF (join_read_key()) access method,
>   don't try to unlock rows in the handler, unless certain that
>   a) they were locked
>   b) they are not used.
>   
>   Unlocking of rows is done by the logic of the nested join loop,
>   and is unaware of the possible caching that the access method may
>   have. This could lead to double unlocking, when a row
>   was unlocked first after reading into the cache, and then
>   when taken from cache, as well as to unlocking of rows which
>   were actually used (but taken from cache).
>   
>   Delegate part of the unlocking logic to the access method,
>   and in JT_EQ_REF count how many times a record was actually
>   used in the join. Unlock it only if it's usage count is 0.
>   
>   Implemented review comments.
2010-02-03 16:32:15 +01:00
MySQL Build Team
4baf459644 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.18
> revision-id: li-bing.song@sun.com-20091103090041-zj7nedx6ok5jgges
> parent: davi.arnaut@sun.com-20091102201021-1brn7cjb1kvqg9gr
> committer: <Li-Bing.Song@sun.com>
> branch nick: mysql-5.0-bugteam
> timestamp: Tue 2009-11-03 17:00:41 +0800
> message:
>   BUG#48216 Replication fails on all slaves after upgrade to 5.0.86 on master
>   
>   When a sessione is closed, all temporary tables of the session are automatically 
>   dropped and are binlogged. But it will be binlogged with wrong database names when
>   the length of the temporary tables' database names are greater than the 
>   length of the current database name or the current database is not set.
>   
>   Query_log_event's db_len is forgot to set when Query_log_event's db is set.
>   This patch wrote code to set db_len immediately after db has set.
2010-02-03 16:31:14 +01:00
MySQL Build Team
0286f0e9b0 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.4.1
> revision-id: alexey.kopytov@sun.com-20091030155453-0vlfwki805h9os62
> parent: joerg@mysql.com-20091016122941-rf6z0keqvmlgjfto
> committer: Alexey Kopytov <Alexey.Kopytov@Sun.com>
> branch nick: my50-bug48131
> timestamp: Fri 2009-10-30 18:54:53 +0300
> message:
>   Bug #48131: crash group by with rollup, distinct, filesort,
>               with temporary tables
>   
>   There were two problems the test case from this bug was
>   triggering:
>   
>   1. JOIN::rollup_init() was supposed to wrap all constant Items
>   into another object for queries with the WITH ROLLUP modifier
>   to ensure they are never considered as constants and therefore
>   are written into temporary tables if the optimizer chooses to
>   employ them for DISTINCT/GROUP BY handling.
>   
>   However, JOIN::rollup_init() was called before
>   make_join_statistics(), so Items corresponding to fields in
>   const tables could not be handled as intended, which was
>   causing all kinds of problems later in the query execution. In
>   particular, create_tmp_table() assumed all constant items
>   except "hidden" ones to be removed earlier by remove_const()
>   which led to improperly initialized Field objects for the
>   temporary table being created. This is what was causing crashes
>   and valgrind errors in storage engines.
>   
>   2. Even when the above problem had been fixed, the query from
>   the test case produced incorrect results due to some
>   DISTINCT/GROUP BY optimizations being performed by the
>   optimizer that are inapplicable in the WITH ROLLUP case.
>   
>   Fixed by disabling inapplicable DISTINCT/GROUP BY optimizations
>   when the WITH ROLLUP modifier is present, and splitting the
>   const-wrapping part of JOIN::rollup_init() into a separate
>   method which is now invoked after make_join_statistics() when
>   the const tables are already known.
2010-02-03 16:29:49 +01:00
MySQL Build Team
7810333553 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.13
> revision-id: joro@sun.com-20091030131543-2b23fnqckgbzvete
> parent: joro@sun.com-20091030094044-quadg0bwjy7cwqzw
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B48291-5.0-bugteam
> timestamp: Fri 2009-10-30 15:15:43 +0200
> message:
>   Bug #48291 : crash with row() operator,select into @var, and 
>     subquery returning multiple rows
>   
>   Error handling was missing when handling subqueires in WHERE 
>   and when assigning a SELECT result to a @variable.
>   This caused crash(es). 
>   
>   Fixed by adding error handling code to both the WHERE 
>   condition evaluation and to assignment to an @variable.
2010-02-03 16:28:51 +01:00
MySQL Build Team
209a75c093 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.12
> revision-id: joro@sun.com-20091030094044-quadg0bwjy7cwqzw
> parent: joro@sun.com-20091029152429-ks55fhrp4lhknyij
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B48293-5.0-bugteam
> timestamp: Fri 2009-10-30 11:40:44 +0200
> message:
>   Bug #48293: crash with procedure analyse, view with > 10 columns,
>   having clause...
>   
>   The fix for bug 46184 was not very complete. It was not covering
>   views using temporary tables and multiple tables in a FROM clause.
>   Fixed by reverting the fix for 46184 and making a more general
>   check that is checking at the right execution stage and for all
>   of the non-supported cases.
>   Now PROCEDURE ANALYZE on non-top level SELECT is also forbidden.
>   Updated the analyse.test and subselect.test accordingly.
2010-02-03 16:27:27 +01:00
MySQL Build Team
e721962484 Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.6
> revision-id: joro@sun.com-20091021084345-iki6z0uceieoupey
> parent: ramil@mysql.com-20091023112648-gie6o3odj57cxh1e
> committer: Georgi Kodinov <joro@sun.com>
> branch nick: B47780-5.0-bugteam
> timestamp: Wed 2009-10-21 11:43:45 +0300
> message:
>   Bug #47780: crash when comparing GIS items from subquery
>         
>   If the first argument to GeomFromWKB function is a geometry
>   field then the function just returns its value.
>   However in doing so it's not preserving first argument's 
>   null_value flag and this causes unexpected null value to
>   be returned to the calling function.
>         
>   Fixed by updating the null_value of the GeomFromWKB function
>   in such cases (and all other cases that return a NULL e.g.
>   because of not enough memory for the return buffer).
2010-02-03 16:26:24 +01:00
MySQL Build Team
f483141b1a Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.5
> revision-id: ramil@mysql.com-20091023112648-gie6o3odj57cxh1e
> parent: ramil@mysql.com-20091021090408-208mvwwrcroi2j8c
> committer: Ramil Kalimullin <ramil@mysql.com>
> branch nick: b48258-5.0-bugteam
> timestamp: Fri 2009-10-23 16:26:48 +0500
> message:
>   Fix for bug#48258: Assertion failed when using a spatial index
>   
>   Problem: involving a spatial index for "non-spatial" queries
>   (that don't containt MBRXXX() functions) may lead to failed assert.
>   
>   Fix: don't use spatial indexes in such cases.
2010-02-03 16:25:25 +01:00
MySQL Build Team
41894be00b Backport into build-201002030816-5.0.87sp1
> ------------------------------------------------------------
> revno: 2818.1.4
> revision-id: ramil@mysql.com-20091021090408-208mvwwrcroi2j8c
> parent: azundris@mysql.com-20091021033856-ydodp4q42o58e7ka
> committer: Ramil Kalimullin <ramil@mysql.com>
> branch nick: b47019-5.0-bugteam
> timestamp: Wed 2009-10-21 14:04:08 +0500
> message:
>   Fix for bug#47019: Assertion failed: 0, file .\rt_mbr.c, 
>   line 138 when forcing a spatial index
>   
>   Problem: "Spatial indexes can be involved in the search 
>   for queries that use a function such as MBRContains() 
>   or MBRWithin() in the WHERE clause".
>   Using spatial indexes for JOINs with =, <=> etc.
>   predicates is incorrect.
>   
>   Fix: disable spatial indexes for such queries.
2010-02-03 16:23:26 +01:00
Georgi Kodinov
44c1a79b0e merge 2010-02-03 17:05:06 +02:00
Joerg Bruehe
a835c80dec Cleanup in the RPM spec file:
Get rid of trailing blanks.
2010-02-02 17:53:52 +01:00
Joerg Bruehe
219422f346 Spec file for "generic" RPMs:
Cleanup, formatting improvements,
vendor is Sun (since MySQL AB was bought).

Backport the change so that RPM doesn't magically
create a dependency on "Perl-DBI".
2010-02-02 16:28:59 +01:00
unknown
65c50b0573 Set version number for mysql-5.0.87sp1 release 2010-02-02 13:09:05 +01:00
Georgi Kodinov
1ff667c995 fixed a typo in bug #49897. 2010-02-01 13:40:16 +02:00
Georgi Kodinov
d468e242b3 Bug #50642 : ssl certs in test suite are expiring soon.
Updated the certs to expire on 2015. 
Made sure they work with both yassl and openssl.
2010-01-29 15:55:46 +02:00
Ramil Kalimullin
172af3722e Fix for bug#49897: crash in ptr_compare when char(0) NOT NULL
column is used for ORDER BY

Problem: filesort isn't meant for null length sort data
(e.g. char(0)), that leads to a server crash.

Fix: disregard sort order if sort data record length is 0 (nothing
to sort).


mysql-test/r/select.result:
  Fix for bug#49897: crash in ptr_compare when char(0) NOT NULL 
  column is used for ORDER BY
    - test result.
mysql-test/t/select.test:
  Fix for bug#49897: crash in ptr_compare when char(0) NOT NULL 
  column is used for ORDER BY
    - test case.
sql/filesort.cc:
  Fix for bug#49897: crash in ptr_compare when char(0) NOT NULL 
  column is used for ORDER BY
    - assert added as filesort cannot handle null length sort data.
sql/sql_select.cc:
  Fix for bug#49897: crash in ptr_compare when char(0) NOT NULL 
  column is used for ORDER BY
    - don't sort null length data e.g. in case of ORDER BY CHAR(0).
2010-01-29 13:17:57 +04:00
Bjorn Munch
b13ed2975d Bug #49210 Enable MTR timeout configuration through environment variables
Define env. vars for both timeout settings
  This patch is for 5.0 (mtr v1) and should replaces for 5.1 up
2010-01-27 15:21:41 +01:00
Staale Smedseng
694d50c71e Bug#50409 Solaris 8 compatibility broken by assumption about
printstack() being present

When Bug#47391 was fixed, no assumption was made that support
for Solaris 8 was needed. Solaris 8 lacks printstack(), and 
the build breaks because of this.

This patch adds a test for the presence of printstack() to
configure.in for 5.0, and uses HAVE_PRINTSTACK to make
decisions rather than the __sun define.
2010-01-27 11:38:50 +01:00
unknown
85c1e30375 Raise version number after cloning 5.0.90 2010-01-15 10:35:35 +01:00
Georgi Kodinov
7ecd6c6d02 version change 2010-01-14 10:24:02 +02:00
Ramil Kalimullin
7fe315483c Auto-merge. 2010-01-13 14:11:42 +04:00
Ramil Kalimullin
495810cd1f Fix for bug#50227: Pre-auth buffer-overflow in mySQL through yaSSL
Problem: copying issuer's (or subject's) name tags into an internal
buffer from incoming stream we didn't check the buffer overflow. 
That may lead to memory overrun, crash etc.

Fix: ensure we don't overrun the buffer.

Note: there's no simple test case (exploit needed).


extra/yassl/taocrypt/include/asn.hpp:
  Fix for bug#50227: Pre-auth buffer-overflow in mySQL through yaSSL
    - CertDecoder::AddTag() introduced.
extra/yassl/taocrypt/src/asn.cpp:
  Fix for bug#50227: Pre-auth buffer-overflow in mySQL through yaSSL
    - copying data from incoming stream to the issuer_ or subject_
  buffers ensure we don't overrun them.
    - code cleanup.
2010-01-13 09:20:45 +04:00
Joerg Bruehe
71465af9d4 Implement the change of RPM versioning and file naming:
- "release" starts from 1
- "level" ("m2", "rc", ...) is included in the RPM version.
2010-01-12 12:41:18 +01:00
Joerg Bruehe
edf7f3350f Merge from main tree,
but don't take the "tree name" change.
2010-01-12 12:12:42 +01:00
Gleb Shchepa
107f34ed77 Bug #49955: ld error message: undefined reference to `strmov_overlapp'
32bit builds with the --enable-assembler flag (enabled by default)
fail with an error message: undefined reference to `strmov_overlapp'.

Since the fix for bug 48866 we use a home-grown strmov function
instead of the ctpcpy function, but the source file for this
function was missed in the Makefile.am.

The strings/Makefile.am file has been modified to include strmov.c
file into ASSEMBLER_x86 and ASSEMBLER_sparc32 sections.


strings/Makefile.am:
  Bug #49955: ld error message: undefined reference to `strmov_overlapp'
  
  The strings/Makefile.am file has been modified to include
  strmov.c file into ASSEMBLER_x86 and ASSEMBLER_sparc32 sections.
2010-01-11 18:21:22 +04:00
unknown
98b989d7b1 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.

sql/log_event.cc:
  Added code to fix valgrind failure on PB2.
2010-01-06 13:12:40 +08:00
unknown
0a64fbc517 Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
Fixed valgrind failure on PB2.

sql/log_event.cc:
  Added code to fix valgrind failure on PB2.
2010-01-06 10:36:29 +08:00
unknown
2b2ce3d6cb Bug #49137 Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
In statement-based or mixed-mode replication, use DROP TEMPORARY TABLE
to drop multiple tables causes different errors on master and slave, 
when one or more of these tables do not exist. Because when executed
on slave, it would automatically add IF EXISTS to the query to ignore
all ER_BAD_TABLE_ERROR errors.

To fix the problem, do not add IF EXISTS when executing DROP TEMPORARY
TABLE on the slave, and clear the ER_BAD_TABLE_ERROR error after
execution if the query does not expect any errors.


mysql-test/r/rpl_drop_temp.result:
  Updated for the patch of bug#49137.
mysql-test/t/rpl_drop_temp.test:
  Added the test file to verify if DROP MULTI TEMPORARY TABLE
  will cause different errors on master and slave, when one or
  more of these tables do not exist.
sql/log_event.cc:
  Added code to handle above cases which are
  removed from sql_parse.cc
sql/sql_parse.cc:
  Remove the code to issue the 'Unknown table' error,
  if the temporary table does not exist when dropping
  it on slave. The above cases decribed in comments
  will be handled later in log_event.cc.
2009-12-31 11:33:10 +08:00
Ramil Kalimullin
732a6a9e36 Auto-merge. 2009-12-26 14:59:56 +04:00
Luis Soares
416df0eaad BUG#48738: post-push fix. Multi-platform test improvements, mainly
to make the test run gracefully on windows.

There was also a syntax error in windows part of the test.
2009-12-24 15:20:58 +00:00
Ramil Kalimullin
7344b58c32 Fix for bug#49570: Assertion failed: !(order->used & map)
on re-execution of prepared statement

Problem: some (see eq_ref_table()) ORDER BY/GROUP BY optimization
is called before each PS execution. However, we don't properly 
initialize its stucture every time before the call.

Fix: properly initialize the sturture used.



mysql-test/r/ps.result:
  Fix for bug#49570: Assertion failed: !(order->used & map) 
  on re-execution of prepared statement
    - test result.
mysql-test/t/ps.test:
  Fix for bug#49570: Assertion failed: !(order->used & map) 
  on re-execution of prepared statement
    - test case.
sql/sql_select.cc:
  Fix for bug#49570: Assertion failed: !(order->used & map) 
  on re-execution of prepared statement
    - set order->used to 0 before each eq_ref_table() call,
  as the function relies on that.
2009-12-22 10:39:29 +04:00
Serge Kozlov
007d77afb9 Bug#8693, Bug#45521. 2009-12-21 14:40:08 +03:00
Davi Arnaut
06a1df9181 Bug#48983: Bad strmake calls (length one too long)
The problem is a somewhat common misusage of the strmake function.
The strmake(dst, src, len) function writes at most /len/ bytes to
the string pointed to by src, not including the trailing null byte.
Hence, if /len/ is the exact length of the destination buffer, a
one byte buffer overflow can occur if the length of the source
string is equal to or greater than /len/.

client/mysqldump.c:
  Make room for the trailing null byte.
libmysql/libmysql.c:
  Add comment, there is enough room in the buffer.
  Increase buffer length, two strings are concatenated.
libmysqld/lib_sql.cc:
  Make room for the trailing null byte.
mysys/default.c:
  Make room for the trailing null bytes.
mysys/mf_pack.c:
  Make room for the trailing null byte.
server-tools/instance-manager/commands.cc:
  Copy only if overflow isn't possible in both cases.
server-tools/instance-manager/listener.cc:
  Make room for the trailing null byte.
sql/log.cc:
  Make room for the trailing null byte.
sql/sp_pcontext.h:
  Cosmetic fix.
sql/sql_acl.cc:
  MAX_HOSTNAME already specifies space for the trailing null byte.
sql/sql_parse.cc:
  Make room for the trailing null byte.
sql/sql_table.cc:
  Make room for the trailing null byte.
2009-12-17 15:58:38 -02:00
Andrei Elkin
522c084631 Bug #49740 rpl.rpl_temporary fails in PB2 in mysql-trunk-merge
The test allowed random coincidence of connection ids for two concurrent
sessions performing CREATE/DROP temp tables.

Fixed with correcting the test. The sessions connection ids are not changed
from their defaults anymore.
2009-12-17 16:34:11 +02:00
Satya B
cf9966f86f Fix for Bug#37408 - Compressed MyISAM files should not require/use mmap()
When compressed myisam files are opened, they are always memory mapped
sometimes causing memory swapping problems.

When we mmap the myisam compressed tables of size greater than the memory 
available, the kswapd0 process utilization is very high consuming 30-40% of 
the cpu. This happens only with linux kernels older than 2.6.9

With newer linux kernels, we don't have this problem of high cpu consumption
and this option may not be required.
 
The option 'myisam_mmap_size' is added to limit the amount of memory used for
memory mapping of myisam files. This option is not dynamic.

The default value on 32 bit system is 4294967295 bytes and on 64 bit system it
is 18446744073709547520 bytes.

Note: Testcase only tests the option variable. The actual bug has be to 
tested manually.

include/my_global.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  define SIZE_T_MAX
include/myisam.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  declare 'myisam_mmap_size' and 'myisam_mmap_used' variables and the mutex
  THR_LOCK_myisam_mmap
myisam/mi_packrec.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add 'myisam_mmap_size' option which limits the memory available to mmap of 
  myisam files
myisam/mi_static.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  declare 'myisam_mmap_size' and 'myisam_mmap_used' variables and the mutex
  THR_LOCK_myisam_mmap
myisam/myisamdef.h:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  move MEMMAP_EXTRA_MARGIN to myisam.h so that it can be used in mysqld.cc
mysql-test/r/variables.result:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  Testcase for BUG#37408 to test the myisam_mmap_size option
mysql-test/t/variables.test:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  Testcase for BUG#37408 to test the myisam_mmap_size option
mysys/my_thr_init.c:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  intialize the lock THR_LOCK_myisam_mmap
sql/mysqld.cc:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add the 'myisam_mmap_size' option
sql/set_var.cc:
  Fix for Bug #37408 - Compressed MyISAM files should not require/use mmap()
  
  add the 'myisam_mmap_size' to the SHOW VARIABLES list
2009-12-17 16:55:50 +05:30
Ramil Kalimullin
06be03f77c Fix for bug#49465: valgrind warnings and incorrect live checksum...
Problem: inserting a record we don't set unused null bits in the
record buffer if no default field values used.
That may lead to wrong live checksum calculation.

Fix: set unused null bits in the record buffer in such cases.


mysql-test/r/myisam.result:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - test result.
mysql-test/t/myisam.test:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - test case.
sql/sql_insert.cc:
  Fix for bug#49465: valgrind warnings and incorrect live checksum...
    - set unused null bits to 1 in the record buffer in case we
  don't call restore_record() before a fill_record() call
  (when no default values used).
2009-12-17 09:55:03 +04:00
Georgi Kodinov
adc17cd41e Bug #48866: mysql.test fails under Fedora 12
strmov() is not guaranteed to work correctly on overlapping
source and destination buffers. On some OSes it may work,
but Fedora 12 has a stpcpy() that's not working correctly 
on overlapping buffers.
Fixed to use the overlap-safe version of strmov instead.
Re-vitalized the overlap-safe version of strmov.
2009-12-16 19:31:19 +02:00
Satya B
1f55f5b617 Bug#49898 - Fix for bug#37408 introduces a linker error
the declaration of THR_LOCK_myisam_mmap in mi_static 
is redundant as it accessible via the extern declaration 
in include/myisam.h

myisam/mi_static.c:
  Bug#49898 - Fix for bug#37408 introduces a linker error
  
  Remove THR_LOCK_myisam_mmap declaration as it is redundant
2009-12-24 12:02:29 +05:30
Luis Soares
d5925fb1d0 BUG#48738: merge local branch into mysql-5.0-bugteam latest. 2009-12-24 02:26:29 +00:00
Sergey Glukhov
081bcb3b8b Bug#47371 reference by same column name
At the end of execution top level join execution
we cleanup this join with true argument.
It leads to underlying join cleanup(subquery) with true argument too
and to tmp_table_param->field array cleanup which is required later.
The problem is that Item_func_set_user_var does not set
result_filed which leads to unnecessary repeated excution of subquery
on final stage.
The fix is to set result_field for Item_func_set_user_var.


mysql-test/r/count_distinct.result:
  test result
mysql-test/r/user_var.result:
  test result
mysql-test/t/count_distinct.test:
  test case
mysql-test/t/user_var.test:
  test case
sql/item_func.cc:
  At the end of execution top level join execution
  we cleanup this join with true argument.
  It leads to underlying join cleanup(subquery) with true argument too
  and to tmp_table_param->field array cleanup which is required later.
  The problem is that Item_func_set_user_var does not set
  result_filed which leads to unnecessary repeated excution of subquery
  on final stage.
  The fix is to set result_field for Item_func_set_user_var.
2009-12-22 13:52:23 +04:00