A Lightweight SQL Database for Cloud Infrastructure and Web Applications

Are FKs handled by core or InnoDB

Asked by Jaka Jančar on 2009-04-11

Hi!

I don't know the architecture of MySQL, but by reading a bit on the forums and MySQL forge, it seems that foreign keys aren't currently handled by MySQL, but by InnoDB engine directly. I think this will change sometime in 6.x.

Is this still the case for Drizzle or are you re-engineering this? If yes, does this mean other storage engines will also support FKs? If no, what is the likelihood that you'll port this (or other things, for that matter) back from MySQL, once it's done there?

Thanks!

Jaka

Question information

Language:
English Edit question
Status:
Solved
For:
Drizzle Edit question
Assignee:
No assignee Edit question
Solved by:
Stewart Smith
Solved:
2009-04-12
Last query:
2009-04-12
Last reply:
2009-04-12
Stewart Smith (stewart) said : #1

Foreign Keys are still handled by each engine that supports them in Drizzle.

Best Stewart Smith (stewart) said : #2

As for porting back teh server-side foreign key work - it depends on the patch and if anybody really does want that feature (I suspect it's not at the top of the feature wish-list for Drizzle)

Jaka Jančar (jaka-kubje) said : #3

Thanks for your answer!

Arjen Lentz (arjen-lentz) said : #4

Parsing (SQL or other language), Storing (persistence of the rule) and Handling (during transaction/query execution) are all different things.

In MySQL, the engine is wholly responsible for all three - this makes for a terrible mess with InnoDB needing to have its own parser. This has on numerous occasions caused bugs with differences in quoting behaviour and the like.

In don't think leaving this the same in Drizzle makes sense. One option would be for Drizzle to just not support FK constraints at all, but perhaps a sensible solution would be to have at least the Parsing (particularly relevant with pluggable parsers) and perhaps the persistence (new FRM store) in the core, with the handling left to each engine.