Commit graph

177 commits

Author SHA1 Message Date
unknown
607b8e5e6e Merge neptunus.(none):/home/msvensson/mysql/my50-m-bug21215
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


client/mysql.cc:
  Auto merged
configure.in:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
client/mysqldump.c:
  Manual merge
mysql-test/r/mysqldump.result:
  Manual merge
mysql-test/t/mysqldump.test:
  Manual merge
2006-08-03 11:48:08 +02:00
unknown
f3919e9284 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge


include/mysql.h:
  Auto merged
include/sql_common.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/r/ps.result:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
mysql-test/t/ps.test:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
sql/sql_prepare.cc:
  Manual merge.
sql/table.cc:
  Manual merge.
tests/mysql_client_test.c:
  Manual merge.
2006-08-02 14:13:01 +04:00
unknown
3c10858474 Fix for BUG#16211: Stored function return type for strings is ignored.
Fix for BUG#16676: Database CHARSET not used for stored procedures

The problem in BUG#16211 is that CHARSET-clause of the return type for
stored functions is just ignored.

The problem in BUG#16676 is that if character set is not explicitly
specified for sp-variable, the server character set is used instead
of the database one.

The fix has two parts:

  - always store CHARSET-clause of the return type along with the
    type definition in mysql.proc.returns column. "Always" means that
    CHARSET-clause is appended even if it has not been explicitly
    specified in CREATE FUNCTION statement (this affects BUG#16211 only).

    Storing CHARSET-clause if it is not specified is essential to avoid
    changing character set if the database character set is altered in
    the future.

    NOTE: this change is not backward compatible with the previous releases.

  - use database default character set if CHARSET-clause is not explicitly
    specified (this affects both BUG#16211 and BUG#16676).

    NOTE: this also breaks backward compatibility.


mysql-test/r/mysqldump.result:
  Updated result file.
mysql-test/r/sp.result:
  Updated result file.
mysql-test/t/sp.test:
  Provided test cases for BUG#16211, BUG#16676.
sql/mysql_priv.h:
  Added two convenient functions for work with databases.
sql/sp.cc:
  1. Add CHARSET-clause to CREATE-statement if it has been explicitly specified.
  2. Polishing -- provided some comments.
sql/sp_head.cc:
  Use database charset as default charset of sp-variable.
sql/sp_head.h:
  Move init_sp_name() out of init_strings().
sql/sql_db.cc:
  Two new functions created:
    - load_db_opt_by_name();
    - check_db_dir_existence();
sql/sql_show.cc:
  Eliminate duplicated code by using
  check_db_dir_existence() and load_db_opt_by_name()
sql/sql_table.cc:
  Eliminate duplicated code by using
  check_db_dir_existence() and load_db_opt_by_name()
sql/sql_yacc.yy:
  Call sp_head::init_sp_name() to initialize stored routine name.
2006-07-27 17:57:43 +04:00
unknown
a08a110878 Bug#21215 mysqldump creating incomplete backups without warning
- Add call to 'safe_exit' function when db query fails.


client/mysqldump.c:
  Add a call to 'safe_exit' to remember the error code and exit unless --force was give.n
mysql-test/r/mysqldump.result:
  Add test result
mysql-test/t/mysqldump.test:
  Add test case
2006-07-24 13:10:24 +02:00
unknown
846a99dcd7 manual merge, part 2/2
mysql-test/r/mysqldump.result:
  manual mergies, part 2/2
2006-07-19 16:50:55 +02:00
unknown
92bbb54092 Merge salvation.intern.azundris.com:/home/tnurnberg/mysql-5.0-release
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.0-merge


support-files/mysql.spec.sh:
  Auto merged
client/mysqldump.c:
  manual merge
mysql-test/r/mysqldump.result:
  manual merge
mysql-test/t/mysqldump.test:
  manual merge
2006-07-19 14:12:30 +02:00
unknown
674636e725 Bug# 20221- Dumping of multiple databases containing view(s) yields maleformed dumps.
client/mysqldump.c:
  When dumping more than one database, make sure that the proper database is selected before restoring that database's views.
  Replaced hard-coded database name length with appropiate token.
mysql-test/r/mysqldump.result:
  Added new result and corrected results for existing test cases.
mysql-test/t/mysqldump.test:
  Added new case for dumping and restoring multiple databases each containing a view.
2006-07-17 18:07:08 -04:00
unknown
1486a426df 4.1 -> 5.0 merge 2006-07-14 13:30:23 -07:00
unknown
2e3ed9c127 Merge igreenhoe@bk-internal.mysql.com:/home/bk/mysql-5.0
into  anubis.greendragongames.com:/home/greenman/workspace-mysql/mysql/merge-4.1_2_5.0


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
2006-07-14 06:52:25 -07:00
unknown
23c514508e 4.1 -> 5.0 merge fixes 2006-07-14 05:56:30 -07:00
unknown
3d35522f9d Bug#21014: Segmentation fault of mysqldump on view
mysqldump did not select the correct database before trying to dump
views from it. this resulted in an empty result set, which in turn
startled mysql-dump into a core-dump.  this only happened for views,
not for tables, and was only visible with multiple databases that
weren't by sheer luck in the order mysqldump required, anyway. this
fixes by selecting the correct database before dumping views; it also
catches the empty set-condition if it should occur for other reasons.


client/mysqldump.c:
  Bug#21014: Segmentation fault of mysqldump on view
  
  failsafe: if "select ... from information_schema.views" returns an
  empty set, don't deref NULL; throw an error instead.
  
  fix: select the correct database not only before dumping tables, but
  before dumping views, as well.
mysql-test/r/mysqldump.result:
  Bug#21014: Segmentation fault of mysqldump on view
  
  show that mysqldump selects the correct database before trying to dump
  views from it.
mysql-test/t/mysqldump.test:
  Bug#21014: Segmentation fault of mysqldump on view
  
  show that mysqldump selects the correct database before trying to dump
  views from it.
2006-07-14 12:50:00 +02:00
unknown
35bfad1e3d 4.1 -> 5.0 merge
client/mysql.cc:
  Auto merged
client/sql_string.h:
  Auto merged
configure.in:
  Auto merged
myisam/mi_create.c:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_string.h:
  Auto merged
sql/table.cc:
  Auto merged
2006-07-13 16:35:25 -07:00
unknown
f27e9254ec Bug#21014: Segmentation fault of mysqldump on view
mysqldump did not select the correct database before trying to dump
views from it. this resulted in an empty result set, which in turn
startled mysql-dump into a core-dump.  this only happened for views,
not for tables, and was only visible with multiple databases that
weren't by sheer luck in the order mysqldump required, anyway. this
fixes by selecting the correct database before dumping views; it also
catches the empty set-condition if it should occur for other reasons.


client/mysqldump.c:
  Bug#21014: Segmentation fault of mysqldump on view
  
  failsafe: if "select ... from information_schema.views" returns an
  empty set, don't deref NULL; throw an error instead.
  
  fix: select the correct database not only before dumping tables, but
  before dumping views, as well.
mysql-test/r/mysqldump.result:
  Bug#21014: Segmentation fault of mysqldump on view
  
  show that mysqldump selects the correct database before trying to dump
  views from it.
mysql-test/t/mysqldump.test:
  Bug#21014: Segmentation fault of mysqldump on view
  
  show that mysqldump selects the correct database before trying to dump
  views from it.
2006-07-14 01:25:13 +02:00
unknown
90ff8fbd38 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/mysql-5.0-maint-18462


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
client/mysqldump.c:
  SCCS merged
2006-06-26 16:15:41 +02:00
unknown
3efeb89246 Fix for bug #15977 (switch ordering of DISABLE KEYS/LOCK TABLE in mysqldump) 2006-06-21 00:12:23 -07:00
unknown
b1bee755a0 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.(none):/home/cmiller/work/mysql/mysql-5.0-maint


client/mysqldump.c:
  Auto merged
BitKeeper/etc/ignore:
  Added BitKeeper/etc/RESYNC_TREE to the ignore list
mysql-test/r/mysqldump.result:
  Manual merge.
mysql-test/t/mysqldump.test:
  Manual merge.
2006-06-20 17:17:04 -04:00
unknown
151fe0cfb0 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
2006-06-19 13:30:54 +02:00
unknown
d0c58cd83c BUG#17201 Changed to other database (BUG#20531 hinders usage of 'test' database)
mysql-test/r/mysqldump.result:
  Changed to other database (BUG#20531 hinders usage of 'test' database)
mysql-test/t/mysqldump.test:
  Changed to other database (BUG#20531 hinders usage of 'test' database)
2006-06-19 13:23:13 +02:00
unknown
4c919abfb0 Merge mysql.com:/users/lthalmann/bkroot/mysql-5.0-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.0-merge


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
2006-06-19 12:09:24 +02:00
unknown
7eec6c3f04 BUG#17201: Removed version number from test case output
mysql-test/r/mysqldump.result:
  Remove comments in mysqldump output
mysql-test/t/mysqldump.test:
  Remove comments in mysqldump output
2006-06-15 11:55:53 +02:00
unknown
fbe342c003 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/mysql-5.0-maint-17371


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
2006-06-12 02:46:26 +02:00
unknown
3989515a59 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/mysql-5.0-maint-18462


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
2006-06-01 07:11:00 +02:00
unknown
c69ba2559b Bug#18462: mysqldump does not dump view structures correctly
(The above problem only occurs with -T -- create a separate file for
each table / view.) This ChangeSet results in correct output of view-
information while omitting the information for the view's stand-in
table. The rationale is that with -T, the user is likely interested
in transferring part of a database, not the db in its entirety (that
would be difficult as replay order is obscure, the files being named
for the table/view they contain rather than getting a sequence number).


client/mysqldump.c:
  Added missing fclose(). Before, a view's stand-in table would get
  dumped in get_table_structure(), and the file would remain open.
  get_view_structure() would re-open the same file and write to it,
  resulting in garbage.  The way we handle it now, the table-struct
  gets closed, then the opening of the view-struct (same name)
  overwrites it. (The SQL for the view drop-if-exists the table,
  anyway.) If this were not desired and we wanted SQL for the views
  that contains the create for the stand-in table, we'd hand a mode
  to open_sql_file_for_table(), which would feature O_APPEND in
  get_view_structure(), but not in get_table_structure().
mysql-test/r/mysqldump.result:
  prove mysqldump -T (each item gets its own file) dumps views correctly
mysql-test/t/mysqldump.test:
  prove mysqldump -T (each item gets its own file) dumps views correctly
2006-05-31 13:36:28 +02:00
unknown
443de04577 Bug#17371: Unable to dump a schema with invalid views
'show create' works even on views that are short of a base-table (this
throw a warning though, like you would expect). Unfortunately, this is
not what mysqldump uses; it creates stand-in tables and hence requests
'show fields' on the view which fails with missing base-tables.  The
--force option prevents the dump from stopping at this point; furthermore
this patch dumps a comment showing create for the offending view for
better diagnostics. This solution was confirmed by submitter as solving
their/clients' problem. Problem might become non-issue once mysqldump no
longer creates stand-in tables.


client/mysqldump.c:
  Dump a comment showing create for a view if we can't show fields for it for
  better diagnostics.
mysql-test/r/mysqldump.result:
  add test for #17371 - be defensive. if we can't do a full dump on a view
  (incl. 'show fields' for a stand-in table), at least create a comment with
  the 'show create' info when --force is given.
mysql-test/t/mysqldump.test:
  add test for #17371 - be defensive. if we can't do a full dump on a view
  (incl. 'show fields' for a stand-in table), at least create a comment with
  the 'show create' info when --force is given.
2006-05-30 14:49:05 +02:00
unknown
1c17a260e5 Update result file after merge 2006-05-29 09:26:31 +02:00
unknown
acf5b9490f Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


mysys/default.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Merge backport
mysql-test/mysql-test-run.sh:
  Merge backport
mysql-test/r/mysqldump.result:
  Manual merge
mysql-test/t/mysqldump.test:
  Manual merge
2006-05-29 09:06:06 +02:00
unknown
e9ad2183c3 manual merge 2006-05-29 11:17:38 +05:00
unknown
45972e0e83 mysqldump.result:
Get output from modified test (dropping t1).
mysqldump.test:
  Drop t1 at end so that the next test doesn't trip over it.


mysql-test/t/mysqldump.test:
  Drop t1 at end so that the next test doesn't trip over it.
mysql-test/r/mysqldump.result:
  Get output from modified test (dropping t1).
2006-05-26 11:00:35 +09:30
unknown
45710b7f47 BUG#17201: Improve handling of views.
client/mysqldump.c:
   Better view handling:
  
    Distinguish better between tables and views in the output.
    
    Add many comments about the distinctions between tables and views, and
    the tradeoffs that we make, notably that, since we don't maintain
    dependencies.
    
    get_table_structure: Clarify in the output that a view is first
    		       created as a workaround for the lack of
    		       dependencies.
    
    dump_table:  Return if we're trying to dump a view.
    
    dump_all_views_in_db: Don't call init_dumping.  It's already been done
                          in dump_all_tables_in_db.  This is the problem
                          reported in BUG#17201.
    
    Change the variable was_views to seen_views, and clarify the comment.
    The previous name was not overly "intuitive".
mysql-test/r/mysqldump.result:
  We no longer have spurious text in the results.
  Add results for the final test (BUG#17201)
mysql-test/t/mysqldump.test:
  Add a new test (BUG#17201)
2006-05-25 17:30:28 +09:30
unknown
81dd2cd096 Merge neptunus.(none):/home/msvensson/mysql/bug15328/my41-bug15328
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/mysqldump.result:
  Manual merge
mysql-test/t/mysqldump.test:
  Manual merge
2006-05-24 10:16:31 +02:00
unknown
c41b767a26 Fix for bug #18536: mysqldump does not maintain table orders as per --tables option
client/mysqldump.c:
  Fix for bug #18536: mysqldump does not maintain table orders as per --tables option
    - use list to store table names instead of hash.
mysql-test/r/mysqldump.result:
  Fix for bug #18536: mysqldump does not maintain table orders as per --tables option
    - test result.
mysql-test/t/mysqldump.test:
  Fix for bug #18536: mysqldump does not maintain table orders as per --tables option
    - test case.
2006-05-19 16:21:32 +05:00
unknown
a9e0d2779e Bug#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
- Check that length of value is longer than 1 before decrementing length by 2.
 - Backport from 5.0, make it possible to use my_print_defaults in tests


mysql-test/mysql-test-run.pl:
  Backport from 5.0, make it possible to use my_print_defaults from tests
mysql-test/mysql-test-run.sh:
  Backport from 5.0, make it possible to use my_print_defaults from tests
mysql-test/r/mysqldump.result:
  Update result
mysql-test/t/mysqldump.test:
  Test that my_print default don't segfault when encountering an option without closing "
mysys/default.c:
  Check that length of value is longer than 1 before deciding to decrement its length by 2.
mysql-test/std_data/bug15328.cnf:
  New BitKeeper file ``mysql-test/std_data/bug15328.cnf''
2006-05-11 14:13:14 +02:00
unknown
f31cb5dd8e Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-4.1
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0


mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/ansi.result:
  Merged from 4.1
mysql-test/r/auto_increment.result:
  Merged from 4.1
mysql-test/r/mysqldump.result:
  Merged from 4.1
mysql-test/r/symlink.result:
  Merged from 4.1
mysql-test/t/auto_increment.test:
  Merged from 4.1
mysql-test/t/mysqldump.test:
  Merged from 4.1
sql/set_var.cc:
  Merged from 4.1
sql/sql_show.cc:
  Merged from 4.1
2006-05-04 18:35:58 +03:00
unknown
d300ceea3f Bug#19025 4.1 mysqldump doesn't correctly dump "auto_increment = [int]"
mysqldump / SHOW CREATE TABLE will show the NEXT available value for
the PK, rather than the *first* one that was available (that named in
the original CREATE TABLE ... AUTO_INCREMENT = ... statement).

This should produce correct and robust behaviour for the obvious use
cases -- when no data were inserted, then we'll produce a statement
featuring the same value the original CREATE TABLE had; if we dump
with values, INSERTing the values on the target machine should set the
correct next_ID anyway (and if not, we'll still have our AUTO_INCREMENT =
... to do that). Lastly, just the CREATE statement (with no data) for
a table that saw inserts would still result in a table that new values
could safely be inserted to).

There seems to be no robust way however to see whether the next_ID
field is > 1 because it was set to something else with CREATE TABLE
... AUTO_INCREMENT = ..., or because there is an AUTO_INCREMENT column
in  the table (but no initial value was set with AUTO_INCREMENT = ...)
and then one or more rows were INSERTed, counting up next_ID. This
means that in both cases, we'll generate an AUTO_INCREMENT =
... clause in SHOW CREATE TABLE / mysqldump.  As we also show info on,
say, charsets even if the user did not explicitly give that info in
their own CREATE TABLE, this shouldn't be an issue.

As per above, the next_ID will be affected by any INSERTs that have
taken place, though.  This /should/ result in correct and robust
behaviour, but it may look non-intuitive to some users if they CREATE
TABLE ... AUTO_INCREMENT = 1000 and later (after some INSERTs) have
SHOW CREATE TABLE give them a different value (say, CREATE TABLE
... AUTO_INCREMENT = 1006), so the docs should possibly feature a
caveat to that effect.

It's not very intuitive the way it works now (with the fix), but it's
*correct*.  We're not storing the original value anyway, if we wanted
that, we'd have to change on-disk representation?

If we do dump/load cycles with empty DBs, nothing will change.  This
changeset includes an additional test case that proves that tables
with rows will create the same next_ID for AUTO_INCREMENT = ... across
dump/restore cycles.

Confirmed by support as likely solution for client's problem.


mysql-test/r/auto_increment.result:
  test for creation of AUTO_INCREMENT=... clause
mysql-test/r/gis-rtree.result:
  Add AUTO_INCREMENT=... clauses where appropriate
mysql-test/r/mysqldump.result:
  show that AUTO_INCREMENT=... will survive dump/restore cycles
mysql-test/r/symlink.result:
  Add AUTO_INCREMENT=... clauses where appropriate
mysql-test/t/auto_increment.test:
  test for creation of AUTO_INCREMENT=... clause
mysql-test/t/mysqldump.test:
  show that AUTO_INCREMENT=... will survive dump/restore cycles
sql/sql_show.cc:
  Add AUTO_INCREMENT=... to output of SHOW CREATE TABLE if there is an
  AUTO_INCREMENT column, and NEXT_ID > 1 (the default).  We must not print
  the clause for engines that do not support this as it would break the
  import of dumps, but as of this writing, the test for whether
  AUTO_INCREMENT columns are allowed and wether AUTO_INCREMENT=...
  is supported is identical, !(file->table_flags() & HA_NO_AUTO_INCREMENT))
  Because of that, we do not explicitly test for the feature,
  but may extrapolate its existence from that of an AUTO_INCREMENT column.
2006-05-04 03:12:51 +02:00
unknown
dafa39f1c4 Fix version of DEFINER-clause in mysqldump.
Now DEFINER-clause in stored routines is expected to appear
in 5.0.20 release, not in 5.0.19. as it was supposed before.


client/mysqldump.c:
  Fixing version.
mysql-test/r/mysqldump.result:
  Updated the result file.
2006-03-10 22:23:04 +03:00
unknown
9a1fed13ee Implementation of WL#2897: Complete definer support in the stored routines.
The idea is to add DEFINER-clause in CREATE PROCEDURE and CREATE FUNCTION
statements. Almost all support of definer in stored routines had been already
done before this patch.

NOTE: this patch changes behaviour of dumping stored routines in mysqldump.
Before this patch, mysqldump did not dump DEFINER-clause for stored routines
and this was documented behaviour. In order to get full information about stored
routines, one should have dumped mysql.proc table. This patch changes this
behaviour, so that DEFINER-clause is dumped.

Since DEFINER-clause is not supported in CREATE PROCEDURE | FUNCTION statements
before this patch, the clause is covered by additional version-specific comments.


client/mysqldump.c:
  Updated the code for dumping stored routines: cover DEFINER-clause
  into version-specific comment.
mysql-test/r/gis.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/information_schema.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/mysqldump.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/rpl_ddl.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/rpl_sp.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/rpl_trigger.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/sp-security.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/sp.result:
  Updated result file after adding DEFINER-clause.
mysql-test/r/sql_mode.result:
  Updated result file after adding DEFINER-clause.
mysql-test/t/sp-security.test:
  Updated result file after adding DEFINER-clause.
sql/sp.cc:
  Added DEFINER-clause.
sql/sp_head.cc:
  Added a new convenient variant of set_definer() operation.
sql/sp_head.h:
  Updated result file after adding DEFINER-clause.
sql/sql_lex.h:
  Renamed trigger_definition_begin into stmt_definition_begin to be used for
  triggers and stored routines.
sql/sql_parse.cc:
  Check DEFINER-clause.
sql/sql_trigger.cc:
  Renamed trigger_definition_begin into stmt_definition_begin to be used for
  triggers and stored routines.
sql/sql_yacc.yy:
  Added DEFINER-clause.
2006-03-02 15:18:49 +03:00
unknown
9eca58895b Merge neptunus.(none):/home/msvensson/mysql/bug16878/my50-bug16878
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


sql/sp_head.cc:
  Auto merged
mysql-test/r/mysqldump.result:
  Merge
mysql-test/t/mysqldump.test:
  Merge
2006-02-21 17:19:46 +01:00
unknown
c9d8cb49ba Merge neptunus.(none):/home/msvensson/mysql/bug14871/my50-bug14871
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
2006-02-21 15:05:58 +01:00
unknown
1f12107f00 Bug#14857 Reading dump files with single statement stored routines fails.Bug #14857 Reading dump files with single statement stored routines fails.
- Add tests, fixed by patch for 16878


mysql-test/r/mysqldump.result:
  Update test results
mysql-test/t/mysqldump.test:
  Add tests for bug 14857
2006-02-21 13:43:29 +01:00
unknown
15c3702598 Bug#14871 mysqldump: invalid view dump output
- Add comments with embeded veriosn info around the parts of the view syntax that are only supported by a certain version of MySQL Server


client/mysqldump.c:
  Use information_schema.views to gather information about the view, then replace some parts of the output from "SHOW CREATE VIEW" with comment markers with version, to make thos parts of the view syntax become parsed only of MySQL servers that supports it.
  Create common function "open_sql_file_for_table" to open the individual .sql file where to dump the table or view.
mysql-test/r/mysqldump.result:
  Update results
mysql-test/t/mysqldump.test:
  Add test to see that views can be deumped and reloaded alos when they contain "SECURITY TYPE", "CHECK OPTION" and "DEFINER"
2006-02-21 13:21:17 +01:00
unknown
c61fb3c359 Replace win filename s with unix equivalent
Evaluate commands passed to "exec" and "system" to expand any $variables before executing command.


client/mysqltest.c:
  do_exec, do_system 
   - call do_eval on the command to be executed in order to expand any $variables
   - Remove old subst_env_var and my_popen, not needed anymore
  Rewrite 'replace_strings' into 'replace_strings_append'
   - copy whole strings instead of byte by byte copy
   - insert result directly inito dynamic_string, no need to check if out 
     string needs to be realloced for every byte.
   - Add comments and DBUG_PRINT's
  New function 'fix_win_paths', detect filenames in win format that should be converted 
  do_eval
  - Only set "escaped" if next char is \ or $
mysql-test/mysql-test-run.pl:
  Always pass path for DBUG .trace file in unix format
  Add search path client_debug to find debug compiled windows binaries
  Remove unused MYSQL_TEST_WINDIR and MASTER_WINMYSOCK
mysql-test/r/mysqldump.result:
  Update test result
mysql-test/t/client_xml.test:
  Use " instead of '
mysql-test/t/mysql_client_test.test:
  Remove the useless "exec echo" command
mysql-test/t/mysqltest.test:
  Escape $variables passed to --exec, that should not be evaluated in exec.
mysql-test/t/rpl000015.test:
  Remove unneccessary replace
mysql-test/t/system_mysql_db_fix.test:
  Call the "shell script" $MYSQL_FIX_SYSTEM_TABLE using --system
2006-02-17 12:07:45 +01:00
unknown
2caa5608c6 Bug#16878 dump of trigger
- Pass "in_comment" variable on to new lex in sp_head::reset_lex
 - Add testcases for dumping and reloading trigger without BEGIN/END


mysql-test/r/mysqldump.result:
  Update test result
mysql-test/t/mysqldump.test:
  Add test for dumping trigger without begin/end, and test that the output from mysqldump can be reloaded.
sql/sp_head.cc:
  If already in a comment before parsing a substatement, set in_comment in the new lex as well.
  This will handle cases where the comment starts before the substatement, which is common in 
  output from mysqldump to mask away syntax not supported by earlier versions of MySQL.
  Ex:
  /*!50003 CREATE TRIGGER `tr1` BEFORE INSERT ON `t1` FOR EACH ROW
  set new.created=now() */;
  ^=== sp_head::reset_lex is called when already in comment
2006-02-09 11:05:28 +01:00
unknown
f315b0b8a7 Fix for BUG#15103: SHOW TRIGGERS: small output alignment problem.
mysql-test/r/information_schema.result:
  Remove extra spaces from result file.
mysql-test/r/mysqldump.result:
  Remove extra spaces from result file.
mysql-test/r/rpl_ddl.result:
  Remove extra spaces from result file.
mysql-test/r/trigger-compat.result:
  Remove extra spaces from result file.
mysql-test/r/trigger-grant.result:
  Remove extra spaces from result file.
mysql-test/r/trigger.result:
  Remove extra spaces from result file.
sql/sql_yacc.yy:
  Remove leading spaces.
2006-01-12 03:02:52 +03:00
unknown
d4d29edb83 Fix for BUG#15110: mysqldump --triggers: does not include DEFINER clause
There are two main idea of this fix:
  - introduce a common function for server and client to split user value
    (<user name>@<host name>) into user name and host name parts;
  - dump DEFINER clause in correct format in mysqldump.


BitKeeper/etc/ignore:
  added client/my_user.c libmysqld/my_user.c sql/my_user.c
client/Makefile.am:
  Use my_user.c in linking of mysqldump executable.
client/mysqldump.c:
  Fix for BUG#15110(mysqldump --triggers: does not include DEFINER clause)
include/Makefile.am:
  Add my_user.c
include/mysql_com.h:
  Introduce a constant for max user length.
libmysqld/Makefile.am:
  Add my_user.c
mysql-test/r/mysqldump.result:
  Update result file.
sql-common/Makefile.am:
  Add my_user.c
sql/Makefile.am:
  Add my_user.c
sql/sp.cc:
  Use constant for max user length.
sql/sp_head.cc:
  Use common function to parse user value.
sql/sql_acl.cc:
  Use constant for max user length.
sql/sql_parse.cc:
  Use constant for max user length.
sql/sql_show.cc:
  Use constant for max user length.
sql/sql_trigger.cc:
  Use constant for max user length.
include/my_user.h:
  A header file for parse_user().
sql-common/my_user.c:
  A new file for parse_user() implementation.
2006-01-11 02:07:40 +03:00
unknown
025d8c14f6 Post-merge result file cleanup
mysql-test/r/mysqldump.result:
  Fix results
2005-12-01 15:10:35 -08:00
unknown
3016ec15be Merge mysql.com:/home/jimw/my/mysql-4.1-13318
into  mysql.com:/home/jimw/my/mysql-5.0-clean


client/mysqldump.c:
  Auto merged
mysql-test/r/mysqldump.result:
  Resolve conflicts
mysql-test/t/mysqldump.test:
  Resolve conflicts
2005-12-01 12:21:29 -08:00
unknown
eb92d6a1e3 Fix values printed by mysqldump for empty blob fields when
--hex-blob is used. (Bug #13318)


client/mysqldump.c:
  Don't use 0x... syntax for empty fields.
mysql-test/r/mysqldump.result:
  Add new results
mysql-test/t/mysqldump.test:
  Add new regression test
2005-11-23 17:31:44 -08:00
unknown
3ecbc8e66e Fixed BUG #14554: mysqldump does not separate "ROW" and trigger
statement for tables created in the IGNORE_SPACE sql mode.


client/mysqldump.c:
  Modified dump_triggers_for_table(): if trigger statement returned
   by SHOW TRIGGERS query does not contain a leading white space,
   additional space is inserted between "ROW" and the statement.
   The leading white spaces are removed by yylex() in the
   IGNORE_SPACE sql mode.
mysql-test/r/mysqldump.result:
  Fixed test case result for bug 14554.
mysql-test/t/mysqldump.test:
  Added test case for bug 14554.
2005-11-21 13:36:48 +03:00
unknown
2ee2747bd2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alik/MySQL/devel/5.0-wl2818


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
mysql-test/r/rpl_sp.result:
  Manual merge.
2005-11-10 22:48:00 +03:00
unknown
7dbea7df27 WL#2818 (Add creator to the trigger definition for privilege
checks on trigger activation)


mysql-test/r/information_schema.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/mysqldump.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_ddl.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_sp.result:
  Update result file: a new clause DEFINER has been added to
  CREATE TRIGGER statement.
mysql-test/r/rpl_trigger.result:
  Results for new test cases were added.
mysql-test/r/skip_grants.result:
  Error message has been changed.
mysql-test/r/trigger.result:
  Added DEFINER column.
mysql-test/r/view.result:
  Error messages have been changed.
mysql-test/r/view_grant.result:
  Error messages have been changed.
mysql-test/t/mysqldump.test:
  Drop created procedure to not affect further tests.
mysql-test/t/rpl_trigger.test:
  Add tests for new column in information schema.
mysql-test/t/skip_grants.test:
  Error tag has been renamed.
mysql-test/t/view.test:
  Error tag has been renamed.
mysql-test/t/view_grant.test:
  Error tag has been changed.
sql/item_func.cc:
  Fix typo in comments.
sql/mysql_priv.h:
  A try to minimize copy&paste:
    - introduce operations to be used from sql_yacc.yy;
    - introduce an operation to be used from trigger and
      view processing code.
sql/share/errmsg.txt:
  - Rename ER_NO_VIEW_USER to ER_MALFORMED_DEFINER in order to
    be shared for view and trigger implementations;
  - Fix a typo;
  - Add a new error code for trigger warning.
sql/sp.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.h:
  set_info() was split into set_info() and set_definer().
sql/sql_acl.cc:
  Add a new check: exit from the cycle if the table is NULL.
sql/sql_lex.h:
  - Rename create_view_definer to definer, since it is used for views
    and triggers;
  - Change st_lex_user to LEX_USER, since st_lex_user is a structure.
    So, formally, it should be "struct st_lex_user", which is longer
    than just LEX_USER;
  - Add trigger_definition_begin.
sql/sql_parse.cc:
  - Add a new check: exit from the cycle if the table is NULL;
  - Implement definer-related functions.
sql/sql_show.cc:
  Add DEFINER column.
sql/sql_trigger.cc:
  Add DEFINER support for triggers.
sql/sql_trigger.h:
  Add DEFINER support for triggers.
sql/sql_view.cc:
  Rename create_view_definer to definer.
sql/sql_yacc.yy:
  Add support for DEFINER-clause in CREATE TRIGGER statement.
  
  Since CREATE TRIGGER and CREATE VIEW can be similar at the start,
  yacc is unable to distinguish between them. So, had to modify both
  statements in order to make it parsable by yacc.
mysql-test/r/trigger-compat.result:
  Result file for triggers backward compatibility test.
mysql-test/r/trigger-grant.result:
  Result file of the test for WL#2818.
mysql-test/t/trigger-compat.test:
  Triggers backward compatibility test: check that the server
  still can load triggers w/o definer attribute and modify
  tables with such triggers (add a new trigger, etc).
mysql-test/t/trigger-grant.test:
  Test for WL#2818 -- check that DEFINER support in triggers
  works properly
2005-11-10 22:25:03 +03:00