r97257 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97256‎ | r97257 | r97258 >
Date:12:25, 16 September 2011
Author:reedy
Status:reverted (Comments)
Tags:
Comment:
* (bug 30927) Omission of MySQLField::maxLength
Modified paths:
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -786,6 +786,10 @@
787787 function isMultipleKey() {
788788 return $this->is_multiple;
789789 }
 790+
 791+ function maxLength() {
 792+ return $this->max_length;
 793+ }
790794 }
791795
792796 class MySQLMasterPos implements DBMasterPos {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97376Revert r97257reedy11:49, 17 September 2011

Comments

#Comment by MaxSem (talk | contribs)   04:05, 17 September 2011

It doesn't do what ORAField::maxLength() mentioned in bug 30927 does. It's not useful for querying database schema or anything. The only reason it was there is that mysql_fetch_field() provided it. Hence, removing it was a concious decision.

#Comment by MaxSem (talk | contribs)   12:59, 17 September 2011

Back home, elaborating on my previous comment:

> $db = wfGetDB( DB_MASTER );
> $db->query( 'CREATE TABLE foo(bar varchar(20))' );
> $db->query("INSERT INTO foo VALUES ('foo'),('fail'),('bar')");
> var_dump( $db->fieldInfo( 'foo', 'bar' )->maxLength() );
int(3) <-- WTF?
#Comment by QuestPC (talk | contribs)   16:57, 17 September 2011

What does it produce in ORAField? Ok, I understand that it is probably impossible to distinguish tinytext from text with mysql_fetch_field().

Status & tagging log