Commit graph

16 commits

Author SHA1 Message Date
Davi Arnaut
c5bb49d020 Bug#36540: CREATE EVENT and ALTER EVENT statements fail with large server_id
The problem is that creating a event could fail if the value of
the variable server_id didn't fit in the originator column of
the event system table. The cause is two-fold: it was possible
to set server_id to a value outside the documented range (from
0 to 2^32-1) and the originator column of the event table didn't
have enough room for values in this range.

The log tables (general_log and slow_log) also don't have a proper
column type to store the server_id and having a large server_id
value could prevent queries from being logged.

The solution is to ensure that all system tables that store the
server_id value have a proper column type (int unsigned) and that
the variable can't be set to a value that is not within the range.
2009-03-11 17:30:56 -03:00
davi@mysql.com/endora.local
5d725bfdf8 Bug#35824: mysql_upgrade does not fix scheduler tables when upgrading from 5.1.23 to 5.1.24
The problem is that when upgrading the event table, the sql_mode
column was always being added instead of being updated to list new
sql_mode values, causing upgrades of the event which already have
a sql_mode column to not be updated to the new sql_mode values.

The solution is to always add first a stub sql_mode column and
subsequently update the column to the new sql_mode values.
2008-04-04 13:46:05 -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
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
anozdrin/alik@ibm.
9fae9ef66f Patch for the following bugs:
- BUG#11986: Stored routines and triggers can fail if the code
    has a non-ascii symbol
  - BUG#16291: mysqldump corrupts string-constants with non-ascii-chars
  - BUG#19443: INFORMATION_SCHEMA does not support charsets properly
  - BUG#21249: Character set of SP-var can be ignored
  - BUG#25212: Character set of string constant is ignored (stored routines)
  - BUG#25221: Character set of string constant is ignored (triggers)

There were a few general problems that caused these bugs:
1. Character set information of the original (definition) query for views,
   triggers, stored routines and events was lost.
2. mysqldump output query in client character set, which can be
   inappropriate to encode definition-query.
3. INFORMATION_SCHEMA used strings with mixed encodings to display object
   definition;

1. No query-definition-character set.

In order to compile query into execution code, some extra data (such as
environment variables or the database character set) is used. The problem
here was that this context was not preserved. So, on the next load it can
differ from the original one, thus the result will be different.

The context contains the following data:
  - client character set;
  - connection collation (character set and collation);
  - collation of the owner database;

The fix is to store this context and use it each time we parse (compile)
and execute the object (stored routine, trigger, ...).

2. Wrong mysqldump-output.

The original query can contain several encodings (by means of character set
introducers). The problem here was that we tried to convert original query
to the mysqldump-client character set.

Moreover, we stored queries in different character sets for different
objects (views, for one, used UTF8, triggers used original character set).

The solution is
  - to store definition queries in the original character set;
  - to change SHOW CREATE statement to output definition query in the
    binary character set (i.e. without any conversion);
  - introduce SHOW CREATE TRIGGER statement;
  - to dump special statements to switch the context to the original one
    before dumping and restore it afterwards.

Note, in order to preserve the database collation at the creation time,
additional ALTER DATABASE might be used (to temporary switch the database
collation back to the original value). In this case, ALTER DATABASE
privilege will be required. This is a backward-incompatible change.

3. INFORMATION_SCHEMA showed non-UTF8 strings

The fix is to generate UTF8-query during the parsing, store it in the object
and show it in the INFORMATION_SCHEMA.

Basically, the idea is to create a copy of the original query convert it to
UTF8. Character set introducers are removed and all text literals are
converted to UTF8.

This UTF8 query is intended to provide user-readable output. It must not be
used to recreate the object.  Specialized SHOW CREATE statements should be
used for this.

The reason for this limitation is the following: the original query can
contain symbols from several character sets (by means of character set
introducers).

Example:

  - original query:
    CREATE VIEW v1 AS SELECT _cp1251 'Hello' AS c1;

  - UTF8 query (for INFORMATION_SCHEMA):
    CREATE VIEW v1 AS SELECT 'Hello' AS c1;
2007-06-28 21:34:54 +04:00
msvensson@pilot.blaudden
4215eb8a50 Bug#28521 Upgrade from 5.1.17 to 5.1.18 breaks events
- Add test for upgrading from 5.1.17 - it's a beta but anyway
   good to have a check oif upgrading new system tables for 5.1
 - Always put the "originator" column after "comment" to get correct
  order of columns in "events" table
2007-05-19 18:55:38 +02:00
msvensson@pilot.blaudden
a4ee7302e6 Merge pilot.blaudden:/home/msvensson/mysql/my51-m-mysql_upgrade
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-04-24 11:11:45 +02:00
msvensson@pilot.blaudden
76285bdf31 Update mysql_upgrade tests for 5.1
Add "two liner" to mysqld --bootstrap that allows
wo write scripts that can be run both by mysql and mysqld --bootstrap
Remove duplicate create of MySQL system tables
2007-04-18 16:23:19 +02:00
cbell/Chuck@mysql_cab_desk.
c7c1b341f7 WL#3629 - Replication of Invocation and Invoked Features
This patch changes test to remove Windows-specific limitations and potential
rounding errors in the calculation of a UDF.

Also corrects a minor merge conflict.
2007-03-29 16:43:00 -04:00
cbell/Chuck@mysql_cab_desk.
a591514a67 Merge cbell@bk-internal.mysql.com:/home/bk/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
2007-03-29 09:54:59 -04:00
cbell/Chuck@mysql_cab_desk.
71c4bd1f0a Merge mysql_cab_desk.:C:/source/c++/mysql-5.1-new-rpl
into  mysql_cab_desk.:C:/source/c++/mysql-5.1_WL_3629
2007-03-26 09:57:16 -04:00
kostja@bodhi.local
39eafdd853 Fix a broken merge. 2007-03-21 19:20:44 +03:00
kostja@bodhi.local
bdb10baec1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime
2007-03-20 00:42:11 +03:00
msvensson@pilot.blaudden
189f592551 Bug#24248 Problem updating from 5.0.15 to 5.1.12 running under Win XP SP2
- Fix error message to say that "mysql_upgrade" should be run when
 a particular error message is found to be missing
 - Dont's set default value on blob's - it will not be used anyway.
2007-03-08 15:43:54 +01:00
msvensson@pilot.blaudden
9cfd569174 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint-bug20166
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
2007-02-28 14:41:57 +01:00
msvensson@pilot.blaudden
e391b86fb0 Bug#20166 mysql-test-run.pl does not test system privilege tables creation
- Split out initial data in mysql_system_tables.sql to  it's own file
 - Use file from mysql_install_db and mysql-test-run
2007-02-28 14:26:58 +01:00
Renamed from scripts/mysql_fix_privilege_tables.sql.in (Browse further)