Commit graph

50 commits

Author SHA1 Message Date
Kent Boortz
9da00ebec9 Updated/added copyright headers 2011-06-30 17:46:53 +02:00
Kent Boortz
1400d7a2cc Updated/added copyright headers 2011-06-30 17:37:13 +02:00
Kent Boortz
e5ce023f57 Updated/added copyright headers 2011-06-30 17:31:31 +02:00
Georgi Kodinov
9fddc97e6d Merged the fix for bug #11936829 to 5.5.11 release
Bug #11936829: DIFF. BETWEEN MYSQL.USER (AUTHENTICATION_STRING) IN 
  FRESH AND UPGRADED 5.5.11
             
There was no modification for pre 5.5.11 builds that had 
authentication_string.  Thus the column was not upgraded 
by mysql_upgrade.
                         
Fixed by adding an ALTER TABLE MODIFY to update an existing 
column to the latest type version.
                                     
Test suite added.
2011-03-31 16:08:31 +03:00
Georgi Kodinov
52edb4a5b9 Bug # 11766011: mysql.user.authentication_string column causes
configuration wizard to fail

Made the fields mysql.user.plugin and mysql.user.authentication_string
nullable to conform with some older clients doing inserts instead of 
using the commands.
2011-03-18 16:16:17 +02:00
Chuck Bell
ba8b8ccb78 BUG#59752 : mysql.user.plugin length (60) vs. mysql.plugin.name length (64)
This patch corrects the problem by fixing the definition and alterations
of the mysql.user table in the .sql files.

Also included are new result files for tests that examine the name 
column of the mysql.user table.
2011-03-11 10:15:57 -05:00
Kent Boortz
94cde4c951 Merge 2010-12-29 01:26:31 +01:00
Kent Boortz
920d185fd8 Merge 2010-12-29 00:47:05 +01:00
Kent Boortz
fddb1f1b13 - Added/updated copyright headers
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
2010-12-28 19:57:23 +01:00
Georgi Kodinov
bb642a5cc0 Bug #57551: Live upgrade fails between 5.1.52 -> 5.5.7-rc
Updated the server to treat a missing mysql.proxies_priv table 
as empty. 
Added some grants to make sure tables are correctly opened
when they must be opened.
Fixed a mysql_upgrade omission not adding rights to root to 
execute GRANT PROXY on other users.
Removed a redundant CREATE TABLE from 
mysql_system_tables_fix.sql since it's always executed after
mysql_system_tables.sql and the first file has CREATE TABLE 
in it. 
Added a test case for the above.
Fixed error handling code to close the cursor
2010-11-19 16:35:04 +02:00
Georgi Kodinov
b69f9b397a Bug #57916: Fix the naming of the proxy_priv table
1. Fixed the name of the table to proxies_priv
2. Fixed the column names to be of the form Capitalized_lowecarse instead of
Capitalized_Capitalized
3. Added Timestamp and Grantor columns
4. Added tests to plugin_auth to check the table structure
5. Updated the existing tests
2010-11-02 17:45:26 +02:00
Georgi Kodinov
881a76699e WL#1054: Pluggable authentication support
Merged the implementation to a new base tree.
2010-08-09 11:32:50 +03:00
Georgi Kodinov
ff381a6a33 merge 2010-07-05 13:22:13 +03:00
Georgi Kodinov
5787f0f20e Bug #53613: mysql_upgrade incorrectly revokes TRIGGER privilege on given table
Fixed an incomplete historical ALTER TABLE MODIFY trimming the trigger 
privilege bit from mysql.tables_priv.Table_priv column.
Removed the duplicate ALTER TABLE MODIFY.
Test suite added.
2010-07-01 12:05:09 +03:00
Alexander Nozdrin
f3635be031 A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)).
The problem was that the code that works with stored routines was present
in mysql_system_tables.sql. This is wrong because until upgrade is finished,
stored routines may be (and were) not available.

The fix is to move that code to the end of mysql_system_tables_fix.sql.
2010-04-14 20:40:04 +04:00
Alexey Kopytov
f10885675c Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Magnus Blåudd
fda5004d36 Merge in fix for bug#42589 2010-03-15 14:57:20 +01:00
Alexey Kopytov
d2452095a5 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in .bzr-mysql/default.conf
Text conflict in mysql-test/r/explain.result
Text conflict in mysql-test/r/having.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in storage/federated/ha_federated.cc
2010-03-07 19:40:59 +03:00
Davi Arnaut
5dd3b617d4 Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL
The problem was that the CSV storage engine does not support NULL
fields, yet in some early 5.1 version the log tables (general_log
and slow_log) were created with null fields. On top of this, when
altering a CSV table column, all fields of the table must be NOT
NULL otherwise the alteration fails.

The solution is to ensure that during upgrade all columns of the
log tables are NOT NULL.
2010-02-26 09:22:48 -03:00
Alexander Nozdrin
09942fe8e8 Manual merge from mysql-trunk-merge.
Conflicts:
  - include/my_no_pthread.h
  - mysql-test/r/sp-ucs2.result
  - sql/log.cc
  - sql/sql_acl.cc
  - sql/sql_yacc.yy
2009-12-16 21:02:21 +03:00
Alexey Kopytov
72b2943594 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2009-12-11 19:40:58 +03:00
lars-erik.bjork@sun.com
99654c27f0 This is a patch for bug#41569.
"mysql_upgrade (ver 5.1) add 3 fields to mysql.proc table but does
not set values".
            
mysql_upgrade (ver 5.1) adds 3 fields (character_set_client, 
collation_connection and db_collation) to the mysql.proc table, but 
does not set any values. When we run stored procedures, which were 
created with mysql 5.0, a warning is logged into the error log.
            
The solution to this is for mysql_upgrade to set default best guess
values for these fields. A warning is also written during upgrade, to
make the user aware that default values are set.
2009-12-03 17:15:47 +01:00
Andrei Elkin
e8e85ed2a6 Manual resolving for the following files
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/r/show_check.result
Text conflict in mysql-test/r/sp-code.result
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/t/show_check.test
Text conflict in mysys/my_delete.c
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/repl_failsafe.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_yacc.yy
Text conflict in storage/myisam/ha_myisam.cc

Corrected results for
 stm_auto_increment_bug33029.reject      2009-12-01
		20:01:49.000000000 +0300
       <andrei> @@ -42,9 +42,6 @@
       <andrei>  RETURN i;
       <andrei>  END//
       <andrei>  CALL p1();
       <andrei> -Warnings:
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.

There should be indeed no Note present because there is in fact autoincrement 
top-level query in sp() that triggers inserting in yet another auto-inc table.
(todo: alert DaoGang to improve the test).
2009-12-01 21:07:18 +02:00
Andrei Elkin
a6f2076c03 merging from 5.1 to rep+2 starting at gca(5.1, next-mr) == build@mysql.com-20091104182209-iui387z35159aoyw 2009-11-30 14:34:39 +02:00
Alexander Nozdrin
2ca5b2c791 Manual merge from mysql-trunk-merge. 2009-11-06 17:20:27 +03:00
Luis Soares
6e068a9cf8 BUG#48048: Deprecated constructs need removal in Betony
NOTE: Backport of:

bzr log -r revid:sp1r-serg@sergbook.mysql.com-20070505200319-38337
------------------------------------------------------------
revno: 2469.263.4
committer: serg@sergbook.mysql.com
timestamp: Sat 2007-05-05 13:03:19 -0700
message:
  Removing deprecated features:
  --master-XXX command-line options
  log_bin_trust_routine_creators
  table_type
  BACKUP TABLE ...
  RESTORE TABLE ...
  SHOW PLUGIN
  LOAD TABLE ... FROM MASTER
  LOAD DATA FROM MASTER
  SHOW INNODB STATUS
  SHOW MUTEX STATUS
  SHOW TABLE TYPES
  ... TIMESTAMP(N)
  ... TYPE=engine
  
  RESET SLAVE don't reset connection parameters anymore
  LOAD DATA: check opt_secure_file_priv before access(filename)
  improved WARN_DEPRECATED macro
2009-11-04 12:28:20 +00:00
Alexander Nozdrin
8c95f3c53b Manual merge from mysql-next-mr. 2009-11-02 14:10:04 +03:00
Sergey Glukhov
1968895ed3 5.0-bugteam->5.1-bugteam merge 2009-10-27 14:09:36 +04:00
Sergey Glukhov
58b7761ed8 Bug#41049 does syntax "grant" case insensitive?
Problem 1:
column_priv_hash uses utf8_general_ci collation
for the key comparison. The key consists of user name,
db name and table name. Thus user with privileges on table t1
is able to perform the same operation on T1
(the similar situation with user name & db name, see acl_cache).
So collation which is used for column_priv_hash and acl_cache
should be case sensitive.
The fix:
replace system_charset_info with my_charset_utf8_bin for
column_priv_hash and acl_cache
Problem 2:
The same situation with proc_priv_hash, func_priv_hash,
the only difference is that Routine name is case insensitive.
So the fix is to use my_charset_utf8_bin for
proc_priv_hash & func_priv_hash and convert routine name into lower
case before writing the element into the hash and
before looking up the key.
Additional fix: mysql.procs_priv Routine_name field collation
is changed to utf8_general_ci.
It's necessary for REVOKE command
(to find a field by routine hash element values).
Note: 
It's safe for lower-case-table-names mode too because
db name & table name are converted into lower case
(see GRANT_NAME::GRANT_NAME).
2009-10-27 12:09:19 +04:00
Sergei Golubchik
df59e27b4e bug#33731 - INSTALL/UNINSTALL PLUGIN: Inconsistent handling of identifier case
indexed column in mysql.plugin table should use case-insensitive collation
for index lookups to work

(backport from 6.0)
2009-10-12 20:15:10 +02:00
Alexander Nozdrin
132ef2e2ef A backporting patch for WL#4300 (Define privileges for tablespaces).
Original revision in 6.0:
------------------------------------------------------------
revno: 2630.13.11
committer: Alexander Nozdrin <alik@mysql.com>
branch nick: 6.0-rt-wl4300
timestamp: Thu 2008-07-24 11:44:21 +0400
message:
  A patch for WL#4300: Define privileges for tablespaces.
------------------------------------------------------------

per-file messages:
  mysql-test/r/grant.result
    Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user.
  mysql-test/r/ps.result
    Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user.
  mysql-test/r/system_mysql_db.result
    Update result file: new columm 'Create_tablespace_priv' has been added to mysql.user.
  mysql-test/suite/falcon/r/falcon_tablespace_priv.result
    Test case for WL#4300.
  mysql-test/suite/falcon/t/falcon_tablespace_priv.test
    Test case for WL#4300.
  mysql-test/suite/ndb/r/ndb_dd_ddl.result
    Test case for WL#4300.
  mysql-test/suite/ndb/t/ndb_dd_ddl.test
    Test case for WL#4300.
  scripts/mysql_system_tables.sql
    New columm 'Create_tablespace_priv' has been added to mysql.user.
  scripts/mysql_system_tables_data.sql
    'CREATE TABLESPACE' is granted by default to the root user.
  scripts/mysql_system_tables_fix.sql
    Grant 'CREATE TABLESPACE' privilege during system table upgrade
    if a user had SUPER privilege.
  sql/sql_acl.cc
    Added CREATE TABLESPACE privilege.
  sql/sql_acl.h
    Added CREATE TABLESPACE privilege.
  sql/sql_parse.cc
    Check global 'CREATE TABLESPACE' privilege for the following SQL statements:
      - CREATE | ALTER | DROP TABLESPACE
      - CREATE | ALTER | DROP LOGFILE GROUP
  sql/sql_show.cc
    Added CREATE TABLESPACE privilege.
  sql/sql_yacc.yy
    Added CREATE TABLESPACE privilege.
2009-10-10 00:01:10 +04:00
Jon Olav Hauglid
ca77f18064 Bug #34197 CREATE PROCEDURE fails when COMMENT truncated in non
strict SQL mode

The problem was that a COMMENT longer than 64 characters
caused CREATE PROCEDURE to fail.

This patch fixed the problem by changing the COMMENT field in 
mysql.proc from char(64) to text. The corresponding ROUTINE_COMMENT
field in INFORMATION_SCHEMA.ROUTINES is also changed from
varchar(64) to longtext.

mysql_system_tables.sql and mysql_system_tables_fix.sql updated.
Test case added to sp.test and affected result-files updated.
2009-10-09 17:35:07 +02:00
Magnus Blåudd
04e99c1009 Bug#42589 mysql_fix_privilege_tables.sh to be deprecated
- Remove remnants of "mysql_fix_privilege_tables.sh"(again)
2009-10-07 15:42:16 +02:00
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
bc69d072f3 Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
- The SQL commands used by mysql_upgrade are written to be run
    with sql_mode set to '' - thus the scripts should change sql_mode
    for the session to make sure the SQL is legal.
2007-05-19 18:15:08 +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)