Skip to content
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

Database::getTableCreate with db prefixes #4

Open
piotr-cz opened this issue Mar 25, 2014 · 3 comments
Open

Database::getTableCreate with db prefixes #4

piotr-cz opened this issue Mar 25, 2014 · 3 comments

Comments

@piotr-cz
Copy link

Database::getTableCreate returns statement with prefixes instead of placeholder #__:

CREATE TABLE `foo_profile` (

Tested on MysqliDriver, but likely same results for other drivers where the method is present: SqliteDriver, OracleDriver, MysqlDriver

@mbabker
Copy link
Contributor

mbabker commented Mar 25, 2014

I might argue this is intended behavior. In MysqliDriver, the database is being queried to get the statement without any post-processing and we don't have any code to replace a prefix with the placeholder currently.

@piotr-cz
Copy link
Author

I'm not sure either whether this is the intended behavior.

the database is being queried to get the statement without any post-processing

The loadRow method invokes execute method which uses replacePrefix method.

The thing is that replacePrefix replaces placeholder with actual prefix, and the getTableCreate should require doing so the other way around.

We are not using this method in the Joomla CMS, and tests just assert return against being an array.

@mbabker
Copy link
Contributor

mbabker commented Aug 3, 2014

If we come up with code to reverse a prefix into the generic #__ then sure, let's implement this change.

mbabker added a commit that referenced this issue Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants