Commit graph

543 commits

Author SHA1 Message Date
Andrei Elkin
2618337eb6 merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
2008-11-12 19:51:47 +02:00
Georgi Kodinov
34d993ac49 merged 5.0 bug 33811 -> 5.1 bug 33811 working tree 2008-11-03 12:40:58 +02:00
Mats Kindahl
1f29c52581 Merging 5.1 main into 5.1-rpl 2008-10-23 21:27:09 +02:00
Georgi Kodinov
a0e3001cdb Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN
fails after the first time
  
Two separate problems : 
  1. When flattening joins the linked list used for name resolution 
  (next_name_resolution_table) was not updated.
  Fixed by updating the pointers when extending the table list
  
  2. The items created by expanding a * (star) as a column reference
  were marked as fixed, but no cached table was assigned to them 
  (unlike what Item_field::fix_fields does).
  Fixed by assigning a cached table (so the re-preparation is done
  faster).
  
Note that the fix for #2 hides the fix for #1 in most cases
(except when a table reference cannot be cached).
2008-10-17 17:55:06 +03:00
Davi Arnaut
7b327a5821 Merge mysql-5.0-bugteam into mysql-5.1-bugteam. 2008-10-15 22:50:56 -03:00
Davi Arnaut
d4c75b7d0f Bug#38823: Invalid memory access when a SP statement does wildcard expansion
The problem is that field names constructed due to wild-card
expansion done inside a stored procedure could point to freed
memory if the expansion was performed after the first call to
the stored procedure.

The problem was solved by patch for Bug#38691. The solution
was to allocate the database, table and field names in the
in the statement memory instead of table memory.
2008-10-14 11:04:36 -03:00
Kristofer Pettersson
53cf8914e4 Merge 5.0-bugteam -> 5.1-bugteam 2008-09-20 16:52:34 +02:00
Kristofer Pettersson
18b3eacbc6 Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar
A stored procedure involving substrings could crash the server on certain
platforms because of invalid memory reads.
          
During storing the new blob-field value, the cached value's address range
overlapped that of the new field value. This caused problems when the 
cached value storage was reallocated to provide access for a new 
characater set representation. The patch checks the address ranges, and if
they overlap, the new field value is copied to a new storage before it is
converted to the new character set.
2008-09-20 10:51:03 +02:00
He Zhenxing
6e86e05823 Merge 5.1 main -> 5.1-rpl 2008-09-06 08:51:17 +08:00
Sergey Glukhov
eeb35b9026 5.0-bugteam->5.1-bugteam merge 2008-08-20 16:42:01 +05: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
Magnus Svensson
3d34d34c88 Merge 5.1->5.1-rpl
Fix paths and name of a few files to make it work with new mtr.pl
2008-05-30 11:12:07 +02:00
thek@adventure.(none)
e836ec9d8d Bug#35997 Event scheduler seems to let the server crash, if it is embedded.
Fixed build failure depending on events in embedded build.
2008-05-13 14:06:32 +02:00
msvensson@pilot.mysql.com
433c1c3d7b Check warnings in servers error log as part of test case 2008-04-08 16:51:26 +02:00
msvensson@pilot.mysql.com
a011d27cf9 Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
2008-04-03 11:50:43 +02:00
msvensson@pilot.mysql.com
56a354794c Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
2008-02-28 12:21:44 +01:00
kaa@kaamos.(none)
5647dee192 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-17 14:57:01 +03:00
kaa@kaamos.(none)
3daeb40f1f Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt
2008-02-17 14:37:39 +03:00
kaa@kaamos.(none)
9f194149b8 Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-13 12:12:00 +03:00
davi@mysql.com/endora.local
1c6768c487 Bug#32633 Can not create any routine if SQL_MODE=no_engine_substitution
The problem is that one can not create a stored routine if sql_mode
contains NO_ENGINE_SUBSTITUTION or PAD_CHAR_TO_FULL_LENGTH. Also when
a event is created, the mode is silently lost if sql_mode contains one
of the aforementioned.  This was happening because the table definitions
which stored sql_mode values weren't being updated to accept new values
of sql_mode.

The solution is to update, in a backwards compatible manner, the various
table definitions (columns) that store the sql_mode value to take into
account the new possible values. One incompatible change is that if a event
that is being created can't be stored to the mysql.event table, an error
will be raised.

The tests case also ensure that new SQL modes will be added to the mysql.proc
and mysql.event tables, otherwise the tests will fail.
2008-02-07 08:47:39 -02:00
evgen@moonbone.local
f967e24718 Bug#30787: Stored function ignores user defined alias.
Simple subselects are pulled into upper selects. This operation substitutes the
pulled subselect for the first item from the select list of the subselect.
If an alias is defined for a subselect it is inherited by the replacement item.
As this is done after fix_fields phase this alias isn't showed if the
replacement item is a stored function. This happens because the Item_func_sp::make_field
function makes send field from its result_field and ignores the defined alias.

Now when an alias is defined the Item_func_sp::make_field function sets it for
the returned field.
2008-01-31 23:46:26 +03:00
malff@lambda.hsd1.co.comcast.net.
e685e7e354 Manual merge 2008-01-23 16:21:09 -07:00
malff@lambda.hsd1.co.comcast.net.
7bd56cfa79 manual merge 2008-01-23 14:52:40 -07:00
malff@lambda.hsd1.co.comcast.net.
c3ad0cac75 Bug#33618 (Crash in sp_rcontext)
Bug 33983 (Stored Procedures: wrong end <label> syntax is accepted)

The server used to crash when REPEAT or another control instruction
was used in conjunction with labels and a LEAVE instruction.

The crash was caused by a missing "pop" of handlers or cursors in the
code representing the stored program. When executing the code in a loop,
this missing "pop" would result in a stack overflow, corrupting memory.

Code generation has been fixed to produce the missing h_pop/c_pop
instructions.

Also, the logic checking that labels at the beginning and the end of a
statement are matched was incorrect, causing Bug 33983.
End labels, when used, must match the label used at the beginning of a block.
2008-01-23 13:26:41 -07:00
anozdrin/alik@ibm.
e5ed653e16 Fix merge. 2008-01-20 00:59:24 +03:00
msvensson@pilot.mysql.com
d918988baa WL#4189
- dynamic configuration support
 - safe process
 - cleanups
 - create new suite for fedarated
2007-12-12 18:19:24 +01:00
gshchepa/uchum@gleb.loc
5ebb07a8c0 rpl_row_tabledefs_2myisam.result, sp.result, rpl_row_colSize.result:
Error message numbers.
2007-10-28 02:09:24 +04:00
anozdrin/alik@station.
49a0f09bbf Fix for BUG#24923: Functions with ENUM issues.
The problem was that the RETURNS column in the mysql.proc was of
CHAR(64). That was not enough for storing long-named datatypes.

The fix is to change CHAR(64) to LONGBLOB, and to throw warnings
at the time a stored routine is created if some data is truncated
during writing into mysql.proc.
2007-10-17 12:13:56 +04:00
malff@lambda.hsd1.co.comcast.net.
ee3e6d8171 Manual merge of 5.0-runtime to 5.1-runtime 2007-10-16 20:47:08 -06:00
malff@lambda.hsd1.co.comcast.net.
a9c6ed46e2 Implementing code review comments 2007-10-16 11:16:31 -06:00
anozdrin/alik@station.
05cf10bdf6 Cleanup sp.test. 2007-10-10 14:42:29 +04:00
anozdrin/alik@station.
c6c419f919 Fix automerge. 2007-10-10 13:53:24 +04:00
kostja@bodhi.(none)
7ec30183bb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-10-08 02:05:55 +04:00
kostja@bodhi.(none)
53b0324824 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-10-08 02:05:10 +04:00
anozdrin/alik@station.
ac875690f7 Fix for BUG#20550: Stored function: wrong RETURN type metadata
when used in a VIEW.

The problem was that wrong function (create_tmp_from_item())
was used to create a temporary field for Item_func_sp.

The fix is to use create_tmp_from_field().
2007-10-05 16:35:01 +04:00
anozdrin/alik@station.
707f067446 Fix for BUG#31035: select from function, group by result crasher.
This actually, fix for the patch for bug-27354. The problem with
the patch was that Item_func_sp::used_tables() was updated, but
Item_func_sp::const_item() was not. So, for Item_func_sp, we had
the following inconsistency:
  - used_tables() returned RAND_TABLE, which means that the item
    can produce "random" results;
  - but const_item() returned TRUE, which means that the item is
    a constant one.

The fix is to change Item_func_sp::const_item() behaviour: it must
return TRUE (an item is a constant one) only if a stored function
is deterministic and each of its arguments (if any) is a constant
item.
2007-10-04 17:19:14 +04:00
gluh@eagle.(none)
88a4df4ec0 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-09-20 14:10:05 +05:00
gluh@mysql.com/eagle.(none)
6b81174cde Bug#27747 database metadata doesn't return sufficient column default info
added get_field_default_value() function which obtains default value from the field
(used in store_create_info() & get_schema_column_record() functions)
2007-09-20 13:54:46 +05:00
gshchepa@devsrv-b.mysql.com
ca15f7b190 Many files:
Merge with 5.0-opt.
2007-09-14 17:21:50 +02:00
gshchepa/uchum@gleb.loc
bd4fd0473c Merge gleb.loc:/home/uchum/work/bk/5.1
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-09-13 00:44:50 +05:00
gshchepa/uchum@gleb.loc
ff042427cf Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-09-12 23:41:35 +05:00
gshchepa/uchum@gleb.loc
d330a49105 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-09-06 22:27:13 +05:00
gshchepa/uchum@gleb.loc
adbe17c8a1 sp.result:
Post-merge fix.
2007-09-06 20:42:36 +05:00
gshchepa/uchum@gleb.loc
4732821e9d Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-09-06 19:15:31 +05:00
davi@moksha.local
2e3ded3ec9 The test case for Bug#29936 doesn't work with the embedded version,
the first query is not running while we are doing wait queries on
a second connection.
2007-09-05 15:03:02 -03:00
malff/marcsql@weblab.(none)
3a7bcd72f3 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge
2007-09-04 14:38:26 -06:00
gluh@mysql.com/eagle.(none)
33eaf2cd95 Bug#29408 Cannot find view in columns table if the selection contains a function
Use view db name as thread default database, in order to ensure
that the view is parsed and prepared correctly.
2007-09-03 12:22:56 +05:00
malff/marcsql@weblab.(none)
496eb569d9 Manual merge 2007-08-29 17:27:38 -06:00
anozdrin/alik@ibm.
290d724943 Test case for Bug#13675: DATETIME/DATE type in store proc param
seems to be converted as varbinary.

The bug has been already fixed. This CS just adds a test case for it.
2007-08-29 14:57:59 +04:00
davi@moksha.local
0b8bc8a96b Add test case for bug 29936 Stored Procedure DML ignores low_priority_updates setting.
This test case uses the wait_condition helper (only available in 5.1) in order to wait till the select/update opens and locks the table.
2007-08-24 19:17:29 -03:00