.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SQL::Translator::Parser::MySQL 3pm" .TH SQL::Translator::Parser::MySQL 3pm "2022-11-19" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SQL::Translator::Parser::MySQL \- parser for MySQL .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use SQL::Translator; \& use SQL::Translator::Parser::MySQL; \& \& my $translator = SQL::Translator\->new; \& $translator\->parser("SQL::Translator::Parser::MySQL"); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The grammar is influenced heavily by Tim Bunce's \*(L"mysql2ora\*(R" grammar. .PP Here's the word from the MySQL site (http://www.mysql.com/doc/en/CREATE_TABLE.html): .PP .Vb 2 \& CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] \& [table_options] [select_statement] \& \& or \& \& CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name LIKE old_table_name; \& \& create_definition: \& col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] \& [PRIMARY KEY] [reference_definition] \& or PRIMARY KEY (index_col_name,...) \& or KEY [index_name] (index_col_name,...) \& or INDEX [index_name] (index_col_name,...) \& or UNIQUE [INDEX] [index_name] (index_col_name,...) \& or FULLTEXT [INDEX] [index_name] (index_col_name,...) \& or [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...) \& [reference_definition] \& or CHECK (expr) \& \& type: \& TINYINT[(length)] [UNSIGNED] [ZEROFILL] \& or SMALLINT[(length)] [UNSIGNED] [ZEROFILL] \& or MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL] \& or INT[(length)] [UNSIGNED] [ZEROFILL] \& or INTEGER[(length)] [UNSIGNED] [ZEROFILL] \& or BIGINT[(length)] [UNSIGNED] [ZEROFILL] \& or REAL[(length,decimals)] [UNSIGNED] [ZEROFILL] \& or DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL] \& or FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL] \& or DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL] \& or NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL] \& or CHAR(length) [BINARY] \& or VARCHAR(length) [BINARY] \& or DATE \& or TIME \& or TIMESTAMP \& or DATETIME \& or TINYBLOB \& or BLOB \& or MEDIUMBLOB \& or LONGBLOB \& or TINYTEXT \& or TEXT \& or MEDIUMTEXT \& or LONGTEXT \& or ENUM(value1,value2,value3,...) \& or SET(value1,value2,value3,...) \& \& index_col_name: \& col_name [(length)] \& \& reference_definition: \& REFERENCES tbl_name [(index_col_name,...)] \& [MATCH FULL | MATCH PARTIAL] \& [ON DELETE reference_option] \& [ON UPDATE reference_option] \& \& reference_option: \& RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT \& \& table_options: \& TYPE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } \& or ENGINE = {BDB | HEAP | ISAM | InnoDB | MERGE | MRG_MYISAM | MYISAM } \& or AUTO_INCREMENT = # \& or AVG_ROW_LENGTH = # \& or [ DEFAULT ] CHARACTER SET charset_name \& or CHECKSUM = {0 | 1} \& or COLLATE collation_name \& or COMMENT = "string" \& or MAX_ROWS = # \& or MIN_ROWS = # \& or PACK_KEYS = {0 | 1 | DEFAULT} \& or PASSWORD = "string" \& or DELAY_KEY_WRITE = {0 | 1} \& or ROW_FORMAT= { default | dynamic | fixed | compressed } \& or RAID_TYPE= {1 | STRIPED | RAID0 } RAID_CHUNKS=# RAID_CHUNKSIZE=# \& or UNION = (table_name,[table_name...]) \& or INSERT_METHOD= {NO | FIRST | LAST } \& or DATA DIRECTORY="absolute path to directory" \& or INDEX DIRECTORY="absolute path to directory" .Ve .PP A subset of the \s-1ALTER TABLE\s0 syntax that allows addition of foreign keys: .PP .Vb 1 \& ALTER [IGNORE] TABLE tbl_name alter_specification [, alter_specification] ... \& \& alter_specification: \& ADD [CONSTRAINT [symbol]] \& FOREIGN KEY [index_name] (index_col_name,...) \& [reference_definition] .Ve .PP A subset of \s-1INSERT\s0 that we ignore: .PP .Vb 1 \& INSERT anything .Ve .SH "ARGUMENTS" .IX Header "ARGUMENTS" This parser takes a single optional parser_arg \f(CW\*(C`mysql_parser_version\*(C'\fR, which provides the desired version for the target database. Any statement in the processed dump file, that is commented with a version higher than the one supplied, will be stripped. .PP The default \f(CW\*(C`mysql_parser_version\*(C'\fR is set to the conservative value of 40000 (MySQL 4.0) .PP Valid version specifiers for \f(CW\*(C`mysql_parser_version\*(C'\fR are listed here .PP More information about the MySQL comment-syntax: .SH "AUTHOR" .IX Header "AUTHOR" Ken Youens-Clark , Chris Mungall . .SH "SEE ALSO" .IX Header "SEE ALSO" Parse::RecDescent, SQL::Translator::Schema.