Last modified: 2014-10-22 19:55:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T73566, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 71566 - table_type is removed in MySQL 5.5.3
table_type is removed in MySQL 5.5.3
Status: NEW
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-10-02 19:02 UTC by Sam Reed (reedy)
Modified: 2014-10-22 19:55 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
a patch based on getServerVersion() (940 bytes, patch)
2014-10-21 06:49 UTC, B. Miller
Details
a far better patch based on getServerVersion() (1.03 KB, patch)
2014-10-21 15:34 UTC, B. Miller
Details
a still better patch based on getServerVersion() and version_compare() (1012 bytes, patch)
2014-10-21 19:53 UTC, B. Miller
Details
an even better patch based on getServerVersion() and version_compare() with simplified regex (998 bytes, patch)
2014-10-21 23:30 UTC, B. Miller
Details
a still better patch, now with additional correct line endings! (999 bytes, patch)
2014-10-21 23:38 UTC, B. Miller
Details

Description Sam Reed (reedy) 2014-10-02 19:02:20 UTC
https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_table_type

This variable was removed in MySQL 5.5.3. Use storage_engine instead.

https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_storage_engine

This variable is deprecated as of MySQL 5.5.3. Use default_storage_engine instead.

This variable was added in MySQL 5.5.3 to be used in preference to storage_engine, which is now deprecated.


From DatabaseMysqlBase.php:1147:

$result = $this->query( 'SHOW FULL TABLES WHERE TABLE_TYPE = "VIEW"' );
Comment 1 Sam Reed (reedy) 2014-10-02 19:15:17 UTC
I fixed WikimediaMaintenance addWiki in https://gerrit.wikimedia.org/r/#/c/164405/
Comment 2 Sam Reed (reedy) 2014-10-02 19:16:38 UTC
We need to vary on MySQL version to whether we use TABLE_TYPE or default_storage_engine
Comment 3 Gerrit Notification Bot 2014-10-03 08:21:28 UTC
Change 164405 had a related patch set uploaded by Legoktm:
table_type -> default_storage_engine

https://gerrit.wikimedia.org/r/164405
Comment 4 Sam Reed (reedy) 2014-10-03 11:16:19 UTC
(In reply to Sam Reed (reedy) from comment #2)
> We need to vary on MySQL version to whether we use TABLE_TYPE or
> default_storage_engine

Unless we want to bump minimum version of MySQL. Doesn't seem a good idea to me for what is only used in core with mysql views. For WikimediaMaintenance, the clue is in the name. Switching the hardcoding is fine as we are using newer mysql
Comment 5 Gerrit Notification Bot 2014-10-08 10:58:10 UTC
Change 164405 merged by jenkins-bot:
table_type -> default_storage_engine

https://gerrit.wikimedia.org/r/164405
Comment 6 Sam Reed (reedy) 2014-10-08 10:58:32 UTC
Core still needs fixing
Comment 7 B. Miller 2014-10-21 06:49:56 UTC
Created attachment 16827 [details]
a patch based on getServerVersion()

I wonder if something like the attached would work well enough.

I'm new here, and I'm sorry to say I'm not sure how to test this.
Comment 8 B. Miller 2014-10-21 15:34:49 UTC
Created attachment 16828 [details]
a far better patch based on getServerVersion()

something like this should actually work for now.

maybe better to query "show variables' and check for default_storage_engine or table_type.
Comment 9 Sam Reed (reedy) 2014-10-21 16:04:21 UTC
You're creating duplicate branches that are probably un-necessary....

Version parsing can be a PITA... Ideally it just needs something like

if version >= 5.5.3
default_storage_engine
else
table_type
Comment 10 Sam Reed (reedy) 2014-10-21 16:14:11 UTC
You probably want to be using version_compare()

http://php.net/manual/en/function.version-compare.php
Comment 11 B. Miller 2014-10-21 19:53:34 UTC
Created attachment 16832 [details]
a still better patch based on getServerVersion() and version_compare()

thanks for the feedback, and the tip on version_compare()!
Comment 12 Sam Reed (reedy) 2014-10-21 20:30:03 UTC
You can simplify the regex using something along the lines of

\d+\.\d+\.\d+


There might be some letter suffixes, but I suspect these don't make much of a difference


but the logic seems about right

> var_dump( version_compare( '10.0.11', '5.5.3', '>=' ) );
bool(true)

> var_dump( version_compare( '5.5.3', '5.5.3', '>=' ) );
bool(true)

> var_dump( version_compare( '5.5.2', '5.5.3', '>=' ) );
bool(false)
Comment 13 B. Miller 2014-10-21 23:30:30 UTC
Created attachment 16836 [details]
an even better patch based on getServerVersion() and version_compare() with simplified regex

here you go...

thanks for the \d reminder!
Comment 14 B. Miller 2014-10-21 23:38:30 UTC
Created attachment 16837 [details]
a still better patch, now with additional correct line endings!
Comment 15 Andre Klapper 2014-10-22 12:13:37 UTC
Thanks for your patch!
You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial
Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Comment 16 Kevin Israel (PleaseStand) 2014-10-22 13:01:57 UTC
(In reply to B. Miller from comment #14)
> Created attachment 16837 [details]
> a still better patch, now with additional correct line endings!

mysql> use testwiki;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT VERSION()\G
*************************** 1. row ***************************
VERSION(): 5.5.40-0ubuntu0.14.04.1
1 row in set (0.00 sec)

mysql> SHOW FULL TABLES WHERE TABLE_TYPE = "VIEW"\G
Empty set (0.00 sec)

mysql> SHOW FULL TABLES WHERE DEFAULT_STORAGE_ENGINE = "VIEW"\G
ERROR 1054 (42S22): Unknown column 'DEFAULT_STORAGE_ENGINE' in 'where clause'
Comment 17 B. Miller 2014-10-22 19:23:37 UTC
I've been wondering whether the TABLE_TYPE in SHOW FULL TABLES was the old MySQL system variable.
Comment 18 Sam Reed (reedy) 2014-10-22 19:55:07 UTC
Same named things that do different things?

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links