* Support for double quoted and bit strings as default values in MySQL parser
* Check in MySQL parser to avoid trying to parse a table defined twice in the same
file as indices (and probably other things) get messed up
+* Workaround for some MySQL quirks on primary key definitions
# ----------------------------------------------------------
# 0.11010 2011-10-05
/foreign key/i
{ $return = '' }
-primary_key_def : primary_key index_name_not_using(?) index_type(?) '(' name_with_opt_paren(s /,/) ')' index_type(?)
+primary_key_def : primary_key index_type(?) '(' name_with_opt_paren(s /,/) ')' index_type(?)
{
$return = {
supertype => 'constraint',
- name => $item[2][0],
type => 'primary_key',
- fields => $item[5],
- options => $item[3][0] || $item[7][0],
+ fields => $item[4],
+ options => $item[2][0] || $item[6][0],
+ };
+ }
+ # In theory, and according to the doc, names should not be allowed here, but
+ # MySQL accept (and ignores) them, so we are not going to be less :)
+ | primary_key index_name_not_using(?) '(' name_with_opt_paren(s /,/) ')' index_type(?)
+ {
+ $return = {
+ supertype => 'constraint',
+ type => 'primary_key',
+ fields => $item[4],
+ options => $item[6][0],
};
}