aaron added a comment.
In T157651#6039302 <https://phabricator.wikimedia.org/T157651#6039302>, @Tgr wrote: > I would suggest the opposite: keep `sql.php`, drop `patchSql.php`. I don't think many people are familiar with the latter (compare patchSql <https://www.mediawiki.org/w/index.php?title=Special:Search&limit=500&offset=0&ns0=1&ns12=1&ns100=1&ns102=1&ns104=1&ns106=1&search=%22patchSql.php%22&advancedSearch-current={}> vs sql <https://www.mediawiki.org/w/index.php?title=Special:Search&limit=500&offset=0&ns0=1&ns12=1&ns100=1&ns102=1&ns104=1&ns106=1&search=%22sql.php%22&advancedSearch-current={}> docs for example) and I don't think it's terribly useful - passing a file path is more user-friendly than passing a patch name. And it does not even replace the schema vars, meaning it's actively harmful to anyone who uses table prefixes or non-default table settings. > So, IMO > > - keep `mysql.php` which is indeed widely used at least in Wikimedia production for debugging, more user-friendly than sql.php (which channels query output through PHP which does weird things to it) and not problematic (it already requires a write flag for performing any changes - although that relies on a master/slave distinction so that could be improved, cf T249683#6039238 <https://phabricator.wikimedia.org/T249683#6039238> - and does not accidentally run updares). > - kill `patchSql.php` which is IMO pretty useless. (Probably worth a wikitech question to ensure it is indeed not used.) > - keep `sql.php` manual debugging mode, which is the only way to debug a non-MySQL server, but require an explicit `--debug` flag used. Do not invoke the updater (not even for variable transformations) when that's used, it seems pointless and just extra code path exposure (cf the fatal error it gave during the incident). > - keep `sql.php` for running scripts but require a `--write` flag like `mysql.php` does for scripts that change data. (I would even separate an admin mode for schema changes and a write mode for data changes via a restricted user.) > - if `sql.php` is invoked with no script file and `--debug` flag just exit with an error (and without creating a DatabaseUpdater or doing anything else nontrivial). This all makes sense to me. Since DDLs are not transactional in mariadb and so on, it adds an extra layer of disruption over "DELETE WHERE 1=1". Permissions with temp tables could get annoying though (Database.php read-only enforcement already has to look out for them). Starting off with a --write flag seems doable for now. It would be nice to make it use a replica DB by default (if --write is missing and --replicadb is not already set to a host or *). TASK DETAIL https://phabricator.wikimedia.org/T157651 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: aaron Cc: Jdforrester-WMF, kostajh, WMDE-leszek, Addshore, Anomie, alaa_wmde, daniel, Ladsgroup, Pablo-WMDE, kchapman, Krinkle, Catrope, Reception123, gerritbot, aaron, Aklapper, Tgr, Blissjay007, Oblanco79, Alter-paule, NavinRizwi, Beast1978, Un1tY, Demian, eprodromou, Hook696, Daryl-TTMG, RomaAmorRoma, E.S.A-Sheild, darthmon_wmde, Kent7301, Meekrab2012, joker88john, 94rain, CucyNoiD, Nandana, Lens0021, NebulousIris, jijiki, Gaboe420, Jony, Versusxo, Majesticalreaper22, Giuliamocci, Adrian1985, Cpaulf30, Imarlier, Lahi, Gq86, Af420, Darkminds3113, Bsandipan, Lordiis, GoranSMilovanovic, Adik2382, 45Jayjay1969, Jayprakash12345, Th3d3v1ls, Ramalepe, Liugev6, QZanden, EnricoCNC, LawExplorer, Vali.matei, WSH1906, Lewizho99, Maathavan, elukey, _jensen, rosalieper, Agabi10, Taiwania_Justo, Scott_WUaS, Pchelolo, SBisson, Wong128hk, Wikidata-bugs, aude, Dcljr, Bawolff, Gryllida, jeblad, ArielGlenn, He7d3r, Mbch331, Rxy, Jay8g, akosiaris
_______________________________________________ Wikidata-bugs mailing list Wikidata-bugs@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs