Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Mysql[i] - list_fields - get all Table with the name *tl_news #7277

Closed
stefanheimes opened this issue Sep 2, 2014 · 5 comments
Closed

Mysql[i] - list_fields - get all Table with the name *tl_news #7277

stefanheimes opened this issue Sep 2, 2014 · 5 comments
Labels
Milestone

Comments

@stefanheimes
Copy link
Contributor

Hi,

we have a little problem with the Database updater. The DB update wants to delete some fields. But the fields didn't exist in the table. After some debuging i find some rows with a SQL statment to fetch all fields from the INFORMATION_SCHEMA. But in this SQL we have a
``TABLE_NAME LIKE '%$strTable' and there was the error. The '%' finds the tl_news and a tmp_tl_news.

So i ask me why we have a '%'. We only want the fields from one table and not from all that have a 'tl_news' at the end of the name or is there a special case?

See:
https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Database/Mysql.php#L142
https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Database/Mysqli.php#L125

@leofeyer leofeyer added the defect label Sep 2, 2014
@leofeyer leofeyer added this to the 3.2.15 milestone Sep 2, 2014
@leofeyer
Copy link
Member

leofeyer commented Sep 2, 2014

So i ask me why we have a '%'.

Me too, honestly. @contao/developers Thoughts?

@ausi
Copy link
Member

ausi commented Sep 2, 2014

Related commit: 3980d2b

I don't see a reason for the %

@Toflar
Copy link
Member

Toflar commented Sep 2, 2014

Neither do I.

@aschempp
Copy link
Member

aschempp commented Sep 3, 2014

I think that's a leftover from sprintf and should be removed.

@leofeyer
Copy link
Member

leofeyer commented Sep 4, 2014

Fixed in c8a8e53.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants