Menu

#12 MySQL Parser bug - comments

open
nobody
None
5
2004-10-29
2004-10-29
No

the mysql parser seems to assume that comments are either for
the table or they preceded a field declaration.

in the code, create_definition allows for comments, yet the context
of this token is in CREATE TABLE, which expects each
create_definition to be comma seperated

I can take a crack at fixing this but it may involve quite a few
changes, I'm not sure the best way to do it.

Here's an example piece of SQL that fails:

CREATE TABLE gene_product (

id integer AUTO_INCREMENT not null PRIMARY KEY,
symbol varchar(128) not null,
# unique id for this gene product in a database; (eg model
organism db)

dbxref_id integer not null,
foreign key (dbxref_id) references dbxref(id),

species_id integer,
foreign key (species_id) references species(id),

# used only in host-pathogen situations
# secondary species is species USING product, not the one
encoding
secondary_species_id integer,
foreign key (species_id) references species(id),

# gene_product type (eg gene, transcript, protein)
# corresponds to col-12 in the gene-association file
# this should be a term in the sequence ontology (SO)
#
# this column is for future expansion - not filled in yet
type_id integer,
foreign key (type_id) references term(id),

full_name text,

# THIS COMMENT CAUSES PARSE FAILURE
unique(dbxref_id)
# THIS COMMENT ALSO CAUSES PARSE FAILURE
);

Discussion


Log in to post a comment.