WL#4052: Preserve character set information of stored objects

Affects: Server-5.1   —   Status: Complete

There were a few problems in the server, that caused 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)

A fix for these problems is quite large and changes existing behavior.
So, this WL item has been created.

The user-visible problems in short:

  - INFORMATION_SCHEMA may produce wrong results.

  - Database dump/restore may fail because:
    - mysqldump may produce wrong results;
    - restoration may fail, because mysqldump outputs incomplete data.

  - Stored programs and views may generate different (unexpected) results
    from time to time.

Update as of 04-Feb-2008
------------------------

This WL item was implemented in 5.1. However, there are the following
follow-ups of this task:

  - BUG#30217: INFORMATION_SCHEMA output is not stable with regard to
    mysqldump/restore;

    This bug discovered that it is impossible to separate the original
    query and query for INFORMATION_SCHEMA. Anyway, INFORMATION_SCHEMA
    query should be built on the actual view definition query.

  - BUG#32538: View definition picks up character set, but not collation

    This bug discovered another issue with normalized SELECT-query,
    used for view definition. It's expected that we'll be suffering from
    bugs similar to that until we use normalized SELECT-query as a view
    definition.

  - WL#4255: Store original view definition query

    This WL item was created to identify the need to use original query
    as a view definition and summarizes all the info about that topic.