New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xml: support table 'opt' attribute with mysqli #267

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
3 participants
@peterdd
Copy link
Contributor

peterdd commented Aug 10, 2016

This is a quickfix just to make it work without impact on other things.
Currently the opt tag is just ignored for mysqli!

@dregad

This comment has been minimized.

Copy link
Member

dregad commented Sep 8, 2016

This feels like a hack... I'm wondering (keep in mind that I don't really use XML schema) if it wouldn't be more appropriate to use $this->parent->db->dataProvider instead ?

@mnewnham

This comment has been minimized.

Copy link
Contributor

mnewnham commented Sep 10, 2016

I agree, My own experience of having to migrate from mysqlt to mysqli in xmlschema files makes me believe that the dataprovider should always be used for xmlschema internals, so it should be:

 $this->opts[$this->parent->db->dataProvider] = $opt;

@dregad dregad changed the title support opt of table for xmlschema03 with mysqli xml: support table 'opt' attribute with mysqli Sep 14, 2016

@dregad dregad added this to the v5.21 milestone Sep 14, 2016

@dregad dregad self-assigned this Sep 14, 2016

@dregad dregad closed this in 27bcd7d Sep 14, 2016

@dregad

This comment has been minimized.

Copy link
Member

dregad commented Sep 15, 2016

Reopening this, following 27bcd7d#commitcomment-19029593.

@peterdd

switching to 'dataProvider' would probably break other db drivers usage in xmlschema03 platform attributes

Are you recommending that I revert 27bcd7d ? As mentioned previously I don't use XML schema much, so I just went with @mnewnham's reply, since you didn't object to it.

@dregad dregad reopened this Sep 15, 2016

@mnewnham

This comment has been minimized.

Copy link
Contributor

mnewnham commented Sep 17, 2016

Point taken about backward compatibility. Perhaps something where we could match either the databaseType or dataProvider might work.

I personally believe that moving forward, we should have a dataprovider option and the users should be encouraged to use that (to avoid the issues that I myself encountered).

Just looking at the code in addTableOpt

if(isset($this->currentPlatform)) {
    $this->opts[$this->parent->db->databaseType] = $opt;
}

This looks problematic because $this->currentPlatform is defined as a class variable, therefore it always exists. It is however set true/false by the constraint tag (but only this). This feels almost like incomplete code that needs deeper investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment