Last active
January 22, 2026 21:02
-
-
Save alexandreelise/d55b73950992803701faf249efa14c86 to your computer and use it in GitHub Desktop.
Detect tables which has hits feature in Joomla core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Use the information table of MySQL to fetch corresponding column name | |
| */ | |
| SELECT CONCAT(a.TABLE_SCHEMA,'.',a.TABLE_NAME,'.',a.COLUMN_NAME) AS c | |
| FROM information_schema.COLUMNS AS a | |
| WHERE a.COLUMN_NAME = 'hits'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Based on previous query, we can improve it to generate actual useful queries to execute later | |
| */ | |
| SELECT CONCAT('UPDATE ', a.TABLE_SCHEMA,'.',a.TABLE_NAME,' AS b ','SET b.',a.COLUMN_NAME, '=0 WHERE true;') AS c | |
| FROM information_schema.COLUMNS AS a | |
| WHERE a.COLUMN_NAME = 'hits'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment