Commit graph

39332 commits

Author SHA1 Message Date
Vladislav Vaintroub
fd70d5e904 Bug#35987 - post-review fix
Correct usage of strncat() in get_symbol_path()

3rd parameter to strncat is changed to be count of 
remaining bytes in the output buffer minus 1.
2008-09-16 13:16:41 +02:00
Tatiana A. Nurnberg
e7c2a13bca auto-merge 2008-09-16 05:59:36 +02:00
Patrick Crews
ef1d6cca00 Bug#37938 Test "mysqldump" lacks various INSERT statements / values
Moved fix for this bug to 5.0 as other mysqldump bugs seem tied to concurrent_insert being on
Setting concurrent_insert off during this test as INSERTs weren't being 
completely processed before the calls to mysqldump, resulting in failing tests.

Altered .test file to turn concurrent_insert off during the test and to restore it
to whatever the value was at the start of the test when complete.

Re-recorded .result file to account for changes to variables in the test.
2008-09-15 15:34:39 -04:00
Vladislav Vaintroub
95af27541e Bug#35987 - crash report on windows doesn't resolve stack traces.
The problem here is that symbols can not be loaded, because symbol
path is not set and  default path does not include the directory
where PDB is located.

The problem is _not_ reproducible on the same machine where
mysqld.exe is built - if PDB is not found in the symbol path,
dbghelp would fallback to fully qualified PDB path as given in the
executable header and on the build host this will succeed.

The solution is to calculate symbol path and pass it to SymInitialize()
call.
2008-09-15 14:58:32 +02:00
Tatiana A. Nurnberg
743149bccf Bug#31434 mysqldump dumps view as table
mysqldump creates stand-in tables before dumping the actual view.
Those tables were of the default type; if the view had more columns
than that (a pathological case, arguably), loading the dump would
fail. We now make the temporary stand-ins MyISAM tables to prevent
this.
2008-09-11 07:46:43 +02:00
Timothy Smith
0582ba50a5 Auto merge 5.0-build -> 5.0-bugteam 2008-09-10 19:34:17 -06:00
Joerg Bruehe
c12f351215 Merge main 5.0 into 5.0-build. 2008-09-10 21:11:22 +02:00
Georgi Kodinov
674d57be85 merged 5.0-5.1.29-rc -> 5.0-bugteam 2008-09-10 12:40:58 +03:00
Ramil Kalimullin
707e676c58 Fix for bug#37526: asymertic operator <=> in trigger
Problem: <=> operator may return wrong results 
comparing NULL and a DATE/DATETIME/TIME value.

Fix: properly check NULLs.
2008-09-09 20:05:27 +05:00
timothy.smith@sun.com
3e5c5570f8 Merge from mysql-5.0.68-release 2008-09-05 21:36:31 +02:00
Ramil Kalimullin
0994c961a7 Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
Problem: SELECT ... REGEXP BINARY NULL may lead to server crash/hang.

Fix: properly handle NULL regular expressions.
2008-09-05 13:30:01 +05:00
Ramil Kalimullin
cdec56dc85 Merge 2008-09-05 12:48:56 +05:00
Ramil Kalimullin
ef13c12c0a Fix for bug#38821: Assert table->auto_increment_field_not_null failed
in open_table()

Problem: repeating "CREATE... ( AUTOINCREMENT) ... SELECT" may lead to
an assertion failure.

Fix: reset table->auto_increment_field_not_null after each record 
writing.
2008-09-03 15:17:19 +05:00
Gleb Shchepa
cfb4a66a5a merge with local tree 2008-09-03 12:59:48 +05:00
Gleb Shchepa
6f94324fd8 Bug #39002: The server crashes on the query:
INSERT .. SELECT .. ON DUPLICATE KEY UPDATE col=DEFAULT

In order to get correct values from update fields that
belongs to the SELECT part in the INSERT .. SELECT .. ON
DUPLICATE KEY UPDATE statement, the server adds referenced
fields to the select list. Part of the code that does this
transformation is shared between implementations of
the DEFAULT(col) function and the DEFAULT keyword (in
the col=DEFAULT expression), and an implementation of
the DEFAULT keyword is incomplete.
2008-09-03 12:32:43 +05:00
Vladislav Vaintroub
b2a49edd4e Bug#37226 Explicit call of my_thread_init() on Windows for every new thread.
Bug#33031 app linked to libmysql.lib crash if run as service in vista under 
localsystem
  

There are some problems using DllMain hook functions on Windows that 
automatically do global and per-thread initialization for libmysqld.dll

1)per-thread initialization(DLL_THREAD_ATTACH)
MySQL internally counts number of active threads that and causes a delay in in 
my_end() if not all threads are exited. But,there are threads that can be 
started either by Windows internally (often in TCP/IP scenarios) or by user 
himself - those threads are not necessarily using libmysql.dll functionality, 
but nonetheless the contribute to the count of open threads.

2)process-initialization (DLL_PROCESS_ATTACH)
my_init() calls WSAStartup that itself loads DLLs and can lead to a deadlock in 
Windows loader.

Fix is to remove dll initialization code from libmysql.dll in general case. I
still leave an environment variable LIBMYSQL_DLLINIT, which if set to any value 
will cause the old behavior (DLL init hooks will be called). This env.variable 
exists only to prevent breakage of existing Windows-only applications that 
don't do mysql_thread_init() and work ok today. Use of LIBMYSQL_DLLINIT is 
discouraged and it will be removed in 6.0
2008-09-01 17:46:37 -04:00
Davi Arnaut
7e8c13745e Restore tree name after merge from main. 2008-09-01 17:11:42 -03:00
Vladislav Vaintroub
5334e5aead merge 2008-09-01 13:27:38 +02:00
Mats Kindahl
5214169192 Merging in 5.0-rpl into 5.0-bugteam 2008-09-01 10:19:17 +02:00
Kent Boortz
6fac985e1c Handle that version "level" might contain "sp1", "a"..... 2008-08-29 17:30:41 +02:00
Matthias Leich
1aac55a67e Merge actual 5.0-bugteam into local tree 2008-08-28 14:18:40 +02:00
Georgi Kodinov
0e3bc47fb4 merge 5.0-main -> 5.0-bugteam 2008-08-28 12:18:35 +03:00
Gleb Shchepa
2c53f10969 Bug #37799: SELECT with a BIT column in WHERE clause
returns unexpected result

If:
  1. a table has a not nullable BIT column c1 with a length
     shorter than 8 bits and some additional not nullable
     columns c2 etc, and
  2. the WHERE clause is like: (c1 = constant) AND c2 ...,
the SELECT query returns unexpected result set.


The server stores BIT columns in a tricky way to save disk
space: if column's bit length is not divisible by 8, the
server places reminder bits among the null bits at the start
of a record. The rest bytes are stored in the record itself,
and Field::ptr points to these rest bytes.

However if a bit length of the whole column is less than 8,
there are no remaining bytes, and there is nothing to store in
the record at its regular place. In this case Field::ptr points
to bytes actually occupied by the next column in a record.
If both columns (BIT and the next column) are NOT NULL,
the Field::eq function incorrectly deduces that this is the
same column, so query transformation/equal item elimination
code (see build_equal_items_for_cond) may mix these columns
and damage conditions containing references to them.
2008-08-28 02:10:37 +05:00
Joerg Bruehe
4cff4db39b Merge the bug fix development (37098: "unpackaged files")
into the 5.0 team tree.
2008-08-27 16:25:24 +02:00
Evgeny Potemkin
1f28ee8875 Bug#38195: Incorrect handling of aggregate functions when loose index scan is
used causes server crash.
      
When the loose index scan access method is used values of aggregated functions
are precomputed by it. Aggregation of such functions shouldn't be performed
in this case and functions should be treated as normal ones.
The create_tmp_table function wasn't taking this into account and this led to
a crash if a query has MIN/MAX aggregate functions and employs temporary table
and loose index scan.
Now the JOIN::exec and the create_tmp_table functions treat MIN/MAX aggregate
functions as normal ones when the loose index scan is used.
2008-08-27 17:03:17 +04:00
Davi Arnaut
0dfbc6803f Merge of mysql-5.0-bugteam branch. 2008-08-26 15:27:04 -03:00
Ramil Kalimullin
73bce72c0a Fix for bug#37277: Potential crash when a spatial index isn't the first key
Typo fixed.
No test case as we actually don't use rtree_get_first() 
and rtree_get_next() at present.
2008-08-26 18:51:06 +05:00
Ramil Kalimullin
4d5670ebf9 Fix for bug #37310: 'on update CURRENT_TIMESTAMP' option crashes the table
Problem: data consistency check (maximum record length) for a correct
MyISAM table with CHECKSUM=1 and ROW_FORMAT=DYNAMIC option 
may fail due to wrong inner MyISAM parameter. In result we may 
have the table marked as 'corrupted'. 

Fix: properly set MyISAM maximum record length parameter.
2008-08-26 18:48:50 +05:00
Alexey Botchkov
d7445d0493 merging fixes 2008-08-26 14:21:07 +05:00
Alexey Botchkov
67e480d269 merging fix 2008-08-26 13:32:43 +05:00
Joerg Bruehe
ff3d230a03 Bug#37098 Get rid of "Installed (but unpackaged)" files in the RPM build
Mostly, this affected files (programs, scripts, and manual pages)
which got built during a RPM build but were not listed in the
appropriate "%files" section of the "spec" file.
This is fixed now, they are added.

To make this consistent, this patch also makes the build of "innochecksum"
(and its inclusion in a tar.gz or other package) depend on whether InnoDB
is configured in the build.

Also, some tools to create Windows packages are irrelevant in any binary
Unix package (not the sources !), and so they are deleted before packaging.
2008-08-25 21:07:41 +02:00
Sergey Petrunia
6677947a95 BUG#36639: subselect.test crashes on 64 bit pentium4 when compiled for valgrind, commit into 5.0
- Use the compiler's default copy constructor for QUICK_RANGE_SELECT. 
  bcopy(this, copy, ...) call caused some odd action on gcc-4.1.2 on x86_64
2008-08-25 21:02:54 +04:00
Davi Arnaut
56f1d32674 Bug#36579 Dumping information about locks in use may lead to a server crash
Dumping information about locks in use by sending a SIGHUP signal
to the server or by invoking the "mysqladmin debug" command may
lead to a server crash in debug builds or to undefined behavior in
production builds.

The problem was that a mutex that protects a lock object (THR_LOCK)
might have been destroyed before the lock object was actually removed
from the list of locks in use, causing a race condition with other
threads iterating over the list. The solution is to destroy the mutex
only after removing lock object from the list.
2008-08-25 10:18:52 -03:00
Sergey Glukhov
515de310f0 Bug#37428 Potential security issue with UDFs - linux shellcode execution.
plugin_dir option backported from 5.1
2008-08-25 17:11:59 +05:00
Timothy Smith
393df2a033 Merge 5.0 main to 5.0-build 2008-08-22 13:04:38 -06:00
Matthias Leich
82aa8e2129 Fix for
Bug#26687 rpl_ddl test fails if run with --innodb option
  Details:
  - The current test + the expected results do only fit
    if the slave uses MyISAM for mysqltest1.t1.
    Therefore skip the test if we do not meet these
    conditions.
  - The solution for 5.1 will look quite different
    because "ps_ddl" is already much improved in
    MySQL 5.1.
2008-08-22 19:49:51 +02:00
Alexey Botchkov
69657f972b Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
test_if_data_home_dir fixed to look into real path.
            Checks added to mi_open for symlinks into data home directory.

per-file messages:
        include/my_sys.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink interface added
        include/myisam.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlink interface added
        myisam/mi_check.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile calls modified
        myisam/mi_open.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          code added to mi_open to check for symlinks into data home directory.
          mi_open_datafile now accepts 'original' file path to check if it's
          an allowed symlink.
        myisam/mi_static.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invlaid_symlink defined
        myisam/myisamchk.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile call modified
        myisam/myisamdef.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          mi_open_datafile interface modified - 'real_path' parameter added
        mysql-test/r/symlink.test
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error codes corrected as some patch now rejected pointing inside datahome
        mysql-test/r/symlink.result
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected in the result
        mysys/my_symlink.c
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          my_is_symlink() implementsd
          my_realpath() now returns the 'realpath' even if a file isn't a symlink
        sql/mysql_priv.h
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          test_if_data_home_dir interface
        sql/mysqld.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          myisam_test_invalid_symlik set with the 'test_if_data_home_dir'
        sql/sql_parse.cc
          Bug#32167 another privilege bypass with DATA/INDEX DIRECTORY.
          
          error messages corrected
          test_if_data_home_dir code fixed
2008-08-22 17:31:53 +05:00
Vladislav Vaintroub
8b9d3a4ea1 Bug #33907 : Errors compiling mysql with Microsoft Visual C++ Express 2008
- Cherry pick 6.0 changes for Visual Studio 2008 support
- Add scripts  win\build-vs9.bat and win\build-vs9_x64.bat

Also, remove CMake generated visual studio project files.
2008-08-21 19:11:17 +02:00
Sergey Glukhov
9bc9ddd56e Bug#38291 memory corruption and server crash with view/sp/function
Send_field.org_col_name has broken value on secondary execution.
It happens when result field is created from the field which belongs to view
due to forgotten assignment of some Send_field attributes. 
The fix:
set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
2008-08-20 14:49:28 +05:00
Georgi Kodinov
53fe782e74 merged 5.0-main to 5.0-bugteam 2008-08-19 14:55:36 +03:00
Georgi Kodinov
4b2dd02552 Bug#38195: Incorrect handling of aggregate functions when loose index scan
is used causes server crash.
  Revert the fix : unstable test case revealed by pushbuild
2008-08-19 13:36:24 +03:00
Chad MILLER
81470ec3e5 Bug#27526: BUILD/check_cpu misbehaving on Debian testing
more clever gcc version checking.
2008-08-18 13:28:46 -04:00
Chad MILLER
410de523fe Merge from 5.0-bugteam trunk. 2008-08-18 13:23:05 -04:00
Chad MILLER
747c3c2b2a Bug#30394: Empty HOME environment variable causes several utilities to crash
Tilde expansion could fail when it was to expand to an empty string (such as
when HOME is set to an empty string), especially on systems where size_t is
unsigned.
2008-08-18 13:06:27 -04:00
Chad MILLER
21e95461b0 Merge from 5.0-bugteam local. 2008-08-18 11:00:19 -04:00
Chad MILLER
2941024852 Bug#37301 Length and Max_length differ with no obvious reason(2nd version)
Length value is the length of the field,
Max_length is the length of the field value.
So Max_length can not be more than Length.
The fix: fixed calculation of the Item_empty_string item length

(Patch applied and queued on demand of Trudy/Davi.)
2008-08-15 16:13:27 -04:00
Chad MILLER
d0cf2fa6e7 Bug#36270: incorrect calculation result - works in 4.1 but not in 5.0 or 5.1
When the fractional part in a multiplication of DECIMALs
overflowed, we truncated the first operand rather than the
longest. Now truncating least significant places instead
for more precise multiplications.

(Queuing at demand of Trudy/Davi.)
2008-08-15 15:46:21 -04:00
Chad MILLER
18e93e8fd9 Correcting tree name in bzr config. Should not include team suffix. 2008-08-15 13:55:05 -04:00
Joerg Bruehe
b0f2e58c68 Merge from main branch. 2008-08-15 12:49:31 +02:00
Ramil Kalimullin
ebe0c22691 Fix for bug #34779: crash in checksum table on federated tables
with blobs containing nulls

Problem: FEDERATED SE improperly stores NULL fields in the record buffer.

Fix: store them properly.
2008-08-15 11:40:05 +05:00