[Wikitech-l] SQL problem

2024-06-01 Thread Martin Domdey
Hi, I want to look in table comment column comment-text for %Unsinn% case-insensitive with this clause: where comment_text collate utf8mb4_general_ci like '%Unsinn%'; but this gives me error: COLLATION 'utf8mb4_general_ci' is not valid for CHARACTER SET 'binary' How can I proceed such a

Re: [Wikitech-l] SQL for reverted and changes

2019-09-09 Thread Strainu
În dum., 8 sept. 2019 la 13:03, Federico Leva (Nemo) a scris: > > This is not a trivial query to perform. There are various strategies and > possible data sources: > https://meta.wikimedia.org/wiki/Research:Revert Thanks Frederico, that python code is very close to what (I believe) I need.

Re: [Wikitech-l] SQL for reverted and changes

2019-09-08 Thread Federico Leva (Nemo)
This is not a trivial query to perform. There are various strategies and possible data sources: https://meta.wikimedia.org/wiki/Research:Revert If you only care about identity reverts, working with rev_sha1 might be enough for you. Federico ___

[Wikitech-l] SQL for reverted and changes

2019-09-07 Thread Strainu
Hi, Can someone help me with an SQL snippet for reverted changes? I know some tools have this metric but I am not able to isolate the relevant query in their code. Thanks, Strainu ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org

[Wikitech-l] SQL strict mode in development

2019-04-04 Thread Antoine Musso
Hello, As of today, MediaWiki development settings now ask MySQL/MariaDB to report error for a wide range of issues that just emitted a warning previously. That is done in includes/DevelopmentSettings.php by setting: $wgSQLMode = 'TRADITIONAL'; As such, you might see database errors

Re: [Wikitech-l] SQL error in unit tests getting ignored

2012-06-20 Thread Antoine Musso
Le 19/06/12 21:29, Jeroen De Dauw a écrit : I refactored some code and then ran tests to see if it all still worked. I forgot renaming a database field somewhere, so had a query that failed. Instead of throwing an exception with the information that would have made the nature of the issue

[Wikitech-l] SQL error in unit tests getting ignored

2012-06-19 Thread Jeroen De Dauw
Hey, I refactored some code and then ran tests to see if it all still worked. I forgot renaming a database field somewhere, so had a query that failed. Instead of throwing an exception with the information that would have made the nature of the issue obvious, DatabaseBase::select returned false

Re: [Wikitech-l] SQL errors

2011-09-04 Thread Aryeh Gregor
On Sat, Sep 3, 2011 at 1:45 PM, Jeroen De Dauw jeroended...@gmail.com wrote: What's the reason for this line? Why truncate after 500 chars? SQL queries can be extremely, extremely long, running to many kilobytes or even a megabyte plus. Platonides is right that one major culprit would be saving

Re: [Wikitech-l] SQL errors

2011-09-03 Thread Jeroen De Dauw
Hey, $sqlx = substr( $commentedSql, 0, 500 ); What's the reason for this line? Why truncate after 500 chars? Cheers -- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. -- ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org

Re: [Wikitech-l] SQL errors

2011-09-03 Thread Jack Phoenix
On Sat, Sep 3, 2011 at 8:45 PM, Jeroen De Dauw jeroended...@gmail.comwrote: $sqlx = substr( $commentedSql, 0, 500 ); What's the reason for this line? Why truncate after 500 chars? Now that's a good question! I did some digging and finally found the revision in which that line was added:

[Wikitech-l] SQL errors

2011-09-02 Thread Jeroen De Dauw
Hey, I have some query API module in which some SQL error is occurring. Now MediaWiki is very helpful in truncating the lines in such a way I can't actually make sense of the error message. http://dpaste.org/hayFO/ Well, what column is unknown? How can I turn of this truncating, or otherwise

Re: [Wikitech-l] SQL errors

2011-09-02 Thread Owen Davis
Jeroen De Dauw jeroendedauw at gmail.com writes: How can I turn of this truncating, or otherwise see the error (preferably w/o having to dig though some log file somewhere)? I have this already: $wgDebugDumpSql = true; This is the one you want, but the log messages are still

Re: [Wikitech-l] SQL: Stored Procedures and MediaWiki

2011-08-07 Thread Daniel Kinzler
Hi Robert As far as I understand, MediaWiki does not use stored procedures, for compatibility reasons. MediaWiki only requires mysql 4.0, which iirc does not support stored procedures at all. Also, stored procedures can not (easily) be ported to other database systems like sqlight. If you want

Re: [Wikitech-l] SQL: Stored Procedures and MediaWiki

2011-08-05 Thread Robert Vogel
Hi Brion, thanks for the hint. Is there a tutorial or documentation on how to use stored procedures in MediaWiki? Do you - or anybody else - know an extension that makes use of this feature? Something we can take a look at? Greetings, Robert Vogel Hallo Welt! - Medienwerkstatt GmbH

Re: [Wikitech-l] SQL: Stored Procedures and MediaWiki

2011-07-28 Thread Robert Vogel
Hi Roan, thanks for the quick reply. This is (one of) the statement(s) we've got a problem with. -- DROP PROCEDURE IF EXISTS `insertfile_getFilePosition`; DELIMITER $$ CREATE PROCEDURE `insertfile_getFilePosition`(filename VARCHAR(255)) BEGIN SELECT tmp.rank FROM

Re: [Wikitech-l] SQL: Stored Procedures and MediaWiki

2011-07-28 Thread Brion Vibber
I suspect the delimiter switch is not being handled by the code that splits the file into statements, so the procedure definition gets split at the first semicolon. -- brion On Jul 28, 2011 3:55 AM, Robert Vogel vo...@hallowelt.biz wrote: Hi Roan, thanks for the quick reply. This is (one of)

[Wikitech-l] SQL: Stored Procedures and MediaWiki update.php

2011-07-27 Thread Robert Vogel
Hello everybody! At my company we develop extensions for MediaWiki. We use the LoadExtensionSchemaUpdates hook to create tables with the maintenance/update.php script. Recently we faced the question whether it is possible to have stored procedures/functions in an extensions SQL-File, or not.

Re: [Wikitech-l] SQL: Stored Procedures and MediaWiki update.php

2011-07-27 Thread Roan Kattouw
On Wed, Jul 27, 2011 at 12:47 PM, Robert Vogel vo...@hallowelt.biz wrote: Hello everybody! At my company we develop extensions for MediaWiki. We use the LoadExtensionSchemaUpdates hook to create tables with the maintenance/update.php script. Recently we faced the question whether it is

Re: [Wikitech-l] SQL

2009-11-26 Thread Tim Starling
李琴 wrote: hi, I want to find something in wikidb. But I don't exectly know how to use the select statement write in WIKI. For ecample . DatabaseBase::select ($ table, $ vars, $ conds = '', $ fname = 'Database::select', $ options = array(), $ join_conds = array() ) How

Re: [Wikitech-l] SQL

2009-11-26 Thread Roan Kattouw
2009/11/26 Tim Starling tstarl...@wikimedia.org: Don't use subselects, they're not supported by MySQL 4.0 which is what we target. $dbr = wfGetDB( DB_SLAVE ); $max = $dbr-selectField(        'recentchanges',        'max(rc_id)',        false,        __METHOD__,        array( 'GROUP BY'

Re: [Wikitech-l] SQL

2009-09-07 Thread Mark Clements (HappyDog)
Roan Kattouw roan.katt...@gmail.com wrote in message news:f154f3a80909050742i90f5949vf0fad7962a154...@mail.gmail.com... 2009/9/5 Helder Geovane Gomes de Lima heldergeov...@gmail.com: But I don't know what to use in the SQL instead of the WHAT?. Does anybody knows what should it be? You

[Wikitech-l] SQL

2009-09-05 Thread Helder Geovane Gomes de Lima
Hello! I was looking at this code http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/intersection/DynamicPageList.php?view=markup and trying to figure out how to change this piece of code if ('lastedit' == $sOrderMethod) $sSqlWhere .= ' ORDER BY page_touched '; else

Re: [Wikitech-l] SQL

2009-09-05 Thread Roan Kattouw
2009/9/5 Helder Geovane Gomes de Lima heldergeov...@gmail.com: But I don't know what to use in the SQL instead of the WHAT?. Does anybody knows what should it be? You should probably use ORDER BY page_namespace, page_title there, which will sort by namespace, then by title. Roan Kattouw