You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

265 lines
15 KiB

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;
19 years ago
20 years ago
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;
19 years ago
  1. drop table if exists t1,t1aa,t2aa;
  2. show tables;
  3. Tables_in_db
  4. columns_priv
  5. db
  6. event
  7. func
  8. general_log
  9. help_category
  10. help_keyword
  11. help_relation
  12. help_topic
  13. host
  14. ndb_binlog_index
  15. plugin
  16. proc
  17. procs_priv
  18. servers
  19. slow_log
  20. tables_priv
  21. time_zone
  22. time_zone_leap_second
  23. time_zone_name
  24. time_zone_transition
  25. time_zone_transition_type
  26. user
  27. show create table db;
  28. Table Create Table
  29. db CREATE TABLE `db` (
  30. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  31. `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  32. `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  33. `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  34. `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  35. `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  36. `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  37. `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  38. `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  39. `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  40. `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  41. `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  42. `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  43. `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  44. `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  45. `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  46. `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  47. `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  48. `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  49. `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  50. `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  51. `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  52. PRIMARY KEY (`Host`,`Db`,`User`),
  53. KEY `User` (`User`)
  54. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges'
  55. show create table host;
  56. Table Create Table
  57. host CREATE TABLE `host` (
  58. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  59. `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  60. `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  61. `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  62. `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  63. `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  64. `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  65. `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  66. `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  67. `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  68. `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  69. `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  70. `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  71. `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  72. `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  73. `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  74. `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  75. `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  76. `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  77. `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  78. PRIMARY KEY (`Host`,`Db`)
  79. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges'
  80. show create table user;
  81. Table Create Table
  82. user CREATE TABLE `user` (
  83. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  84. `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  85. `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
  86. `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  87. `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  88. `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  89. `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  90. `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  91. `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  92. `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  93. `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  94. `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  95. `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  96. `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  97. `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  98. `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  99. `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  100. `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  101. `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  102. `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  103. `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  104. `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  105. `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  106. `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  107. `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  108. `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  109. `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  110. `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  111. `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  112. `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  113. `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
  114. `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
  115. `ssl_cipher` blob NOT NULL,
  116. `x509_issuer` blob NOT NULL,
  117. `x509_subject` blob NOT NULL,
  118. `max_questions` int(11) unsigned NOT NULL DEFAULT '0',
  119. `max_updates` int(11) unsigned NOT NULL DEFAULT '0',
  120. `max_connections` int(11) unsigned NOT NULL DEFAULT '0',
  121. `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0',
  122. PRIMARY KEY (`Host`,`User`)
  123. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges'
  124. show create table func;
  125. Table Create Table
  126. func CREATE TABLE `func` (
  127. `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  128. `ret` tinyint(1) NOT NULL DEFAULT '0',
  129. `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
  130. `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL,
  131. PRIMARY KEY (`name`)
  132. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions'
  133. show create table tables_priv;
  134. Table Create Table
  135. tables_priv CREATE TABLE `tables_priv` (
  136. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  137. `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  138. `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  139. `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  140. `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
  141. `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  142. `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '',
  143. `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
  144. PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
  145. KEY `Grantor` (`Grantor`)
  146. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges'
  147. show create table columns_priv;
  148. Table Create Table
  149. columns_priv CREATE TABLE `columns_priv` (
  150. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  151. `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  152. `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  153. `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  154. `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  155. `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  156. `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '',
  157. PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
  158. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges'
  159. show create table procs_priv;
  160. Table Create Table
  161. procs_priv CREATE TABLE `procs_priv` (
  162. `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
  163. `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  164. `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '',
  165. `Routine_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  166. `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL,
  167. `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '',
  168. `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '',
  169. `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  170. PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`),
  171. KEY `Grantor` (`Grantor`)
  172. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges'
  173. show create table servers;
  174. Table Create Table
  175. servers CREATE TABLE `servers` (
  176. `Server_name` char(64) NOT NULL DEFAULT '',
  177. `Host` char(64) NOT NULL DEFAULT '',
  178. `Db` char(64) NOT NULL DEFAULT '',
  179. `Username` char(64) NOT NULL DEFAULT '',
  180. `Password` char(64) NOT NULL DEFAULT '',
  181. `Port` int(4) NOT NULL DEFAULT '0',
  182. `Socket` char(64) NOT NULL DEFAULT '',
  183. `Wrapper` char(64) NOT NULL DEFAULT '',
  184. `Owner` char(64) NOT NULL DEFAULT '',
  185. PRIMARY KEY (`Server_name`)
  186. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table'
  187. show create table proc;
  188. Table Create Table
  189. proc CREATE TABLE `proc` (
  190. `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  191. `name` char(64) NOT NULL DEFAULT '',
  192. `type` enum('FUNCTION','PROCEDURE') NOT NULL,
  193. `specific_name` char(64) NOT NULL DEFAULT '',
  194. `language` enum('SQL') NOT NULL DEFAULT 'SQL',
  195. `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL',
  196. `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO',
  197. `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER',
  198. `param_list` blob NOT NULL,
  199. `returns` char(64) NOT NULL DEFAULT '',
  200. `body` longblob NOT NULL,
  201. `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  202. `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  203. `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  204. `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '',
  205. `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  206. `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  207. `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  208. `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  209. `body_utf8` longblob,
  210. PRIMARY KEY (`db`,`name`,`type`)
  211. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures'
  212. show create table event;
  213. Table Create Table
  214. event CREATE TABLE `event` (
  215. `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  216. `name` char(64) NOT NULL DEFAULT '',
  217. `body` longblob NOT NULL,
  218. `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  219. `execute_at` datetime DEFAULT NULL,
  220. `interval_value` int(11) DEFAULT NULL,
  221. `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL,
  222. `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  223. `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  224. `last_executed` datetime DEFAULT NULL,
  225. `starts` datetime DEFAULT NULL,
  226. `ends` datetime DEFAULT NULL,
  227. `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED',
  228. `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP',
  229. `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE') NOT NULL DEFAULT '',
  230. `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  231. `originator` int(10) NOT NULL,
  232. `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
  233. `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  234. `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  235. `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  236. `body_utf8` longblob,
  237. PRIMARY KEY (`db`,`name`)
  238. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events'
  239. show create table general_log;
  240. Table Create Table
  241. general_log CREATE TABLE `general_log` (
  242. `event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  243. `user_host` mediumtext NOT NULL,
  244. `thread_id` int(11) NOT NULL,
  245. `server_id` int(11) NOT NULL,
  246. `command_type` varchar(64) NOT NULL,
  247. `argument` mediumtext NOT NULL
  248. ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
  249. show create table slow_log;
  250. Table Create Table
  251. slow_log CREATE TABLE `slow_log` (
  252. `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  253. `user_host` mediumtext NOT NULL,
  254. `query_time` time NOT NULL,
  255. `lock_time` time NOT NULL,
  256. `rows_sent` int(11) NOT NULL,
  257. `rows_examined` int(11) NOT NULL,
  258. `db` varchar(512) NOT NULL,
  259. `last_insert_id` int(11) NOT NULL,
  260. `insert_id` int(11) NOT NULL,
  261. `server_id` int(11) NOT NULL,
  262. `sql_text` mediumtext NOT NULL
  263. ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
  264. show tables;
  265. Tables_in_test