Hi!
>>>>> "DAVE" == DAVE THOMAS <DAVET@stripped> writes:
DAVE> Hi, I am trying to make a new table type in MySQL. I want to be able to
DAVE> specify type=disam in my create table statement. The statement I am using
DAVE> is:
mysql> create table dave (ID int, CreateDate date) type=disam;
DAVE> The error I am getting is:
DAVE> ERROR 1064: You have an error in your SQL syntax near 'disam' at line 1.
DAVE> So far I have done the following:
DAVE> - Written a ha_disam.cc and ha_disam.h that are based on ha_myisam.*
DAVE> - I over-rided the virtual functions from the base class (class handler)
DAVE> - modified sql_yacc.yy and lex.h everywhere I found code dealing with MYISAM
DAVE> I copied it and changed it to DISAM
DAVE> - I added DB_TYPE_DISAM to 'enum db_type' in handler.h
DAVE> - I copied the MYISAM code in handler.cc and changed it to DISAM.
DAVE> Is there anything that I am not changing that needs to be changed? Any help
DAVE> is appreciated! Thanks
DAVE> Dave
To get MySQL to recognize the DISAM and keyword, you have to do
the following:
- In sql/sql_yacc.yy, look for MYISAM_SYM and add identical rules for
DISAM_SYM.
- In sql/lex.h add in the first table (under "MYISAM"):
{ "DISAM", SYM(DISAM_SYM),0,0},
Note: to compile sql_yacc.yy, to sql_yacc.cc you need to have 'bison'
installed! (You probably have this already!)
Regards,
Monty