From 9441dde8bfb95277df073717ed7817dced40f948 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 28 Mar 2014 05:41:12 +0100 Subject: Update to MediaWiki 1.22.5 --- tests/phpunit/data/db/mysql/functions.sql | 12 + tests/phpunit/data/db/postgres/functions.sql | 12 + tests/phpunit/data/db/sqlite/tables-1.13.sql | 342 +++++++++++++ tests/phpunit/data/db/sqlite/tables-1.15.sql | 454 ++++++++++++++++++ tests/phpunit/data/db/sqlite/tables-1.16.sql | 478 +++++++++++++++++++ tests/phpunit/data/db/sqlite/tables-1.17.sql | 511 ++++++++++++++++++++ tests/phpunit/data/db/sqlite/tables-1.18.sql | 530 +++++++++++++++++++++ .../data/less/common/test.common.mixins.less | 5 + tests/phpunit/data/less/module/dependency.less | 3 + tests/phpunit/data/less/module/styles.css | 6 + tests/phpunit/data/less/module/styles.less | 6 + tests/phpunit/data/media/1bit-png.png | Bin 0 -> 167 bytes tests/phpunit/data/media/80x60-2layers.xcf | Bin 0 -> 1162 bytes tests/phpunit/data/media/80x60-Greyscale.xcf | Bin 0 -> 667 bytes tests/phpunit/data/media/80x60-RGB.xcf | Bin 0 -> 677 bytes .../Animated_PNG_example_bouncing_beach_ball.png | Bin 0 -> 72209 bytes tests/phpunit/data/media/Gtk-media-play-ltr.svg | 35 ++ tests/phpunit/data/media/Png-native-test.png | Bin 0 -> 4665 bytes tests/phpunit/data/media/QA_icon.svg | 77 +++ tests/phpunit/data/media/README | 38 ++ tests/phpunit/data/media/Toll_Texas_1.svg | 150 ++++++ .../media/US_states_by_total_state_tax_revenue.svg | 248 ++++++++++ tests/phpunit/data/media/Wikimedia-logo.svg | 14 + .../data/media/Xmp-exif-multilingual_test.jpg | Bin 0 -> 12544 bytes tests/phpunit/data/media/animated-xmp.gif | Bin 0 -> 3864 bytes tests/phpunit/data/media/animated.gif | Bin 0 -> 497 bytes tests/phpunit/data/media/broken_exif_date.jpg | Bin 0 -> 3233 bytes tests/phpunit/data/media/exif-gps.jpg | Bin 0 -> 665 bytes tests/phpunit/data/media/exif-user-comment.jpg | Bin 0 -> 484 bytes tests/phpunit/data/media/greyscale-na-png.png | Bin 0 -> 365 bytes tests/phpunit/data/media/greyscale-png.png | Bin 0 -> 415 bytes tests/phpunit/data/media/iptc-invalid-psir.jpg | Bin 0 -> 9574 bytes tests/phpunit/data/media/iptc-timetest-invalid.jpg | Bin 0 -> 9573 bytes tests/phpunit/data/media/iptc-timetest.jpg | Bin 0 -> 9573 bytes tests/phpunit/data/media/jpeg-comment-binary.jpg | Bin 0 -> 448 bytes .../phpunit/data/media/jpeg-comment-iso8859-1.jpg | Bin 0 -> 447 bytes tests/phpunit/data/media/jpeg-comment-multiple.jpg | Bin 0 -> 431 bytes tests/phpunit/data/media/jpeg-comment-utf.jpg | Bin 0 -> 445 bytes tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg | Bin 0 -> 499 bytes tests/phpunit/data/media/jpeg-iptc-good-hash.jpg | Bin 0 -> 499 bytes tests/phpunit/data/media/jpeg-padding-even.jpg | Bin 0 -> 450 bytes tests/phpunit/data/media/jpeg-padding-odd.jpg | Bin 0 -> 451 bytes tests/phpunit/data/media/jpeg-xmp-alt.jpg | Bin 0 -> 3255 bytes tests/phpunit/data/media/jpeg-xmp-psir.jpg | Bin 0 -> 3308 bytes tests/phpunit/data/media/jpeg-xmp-psir.xmp | 35 ++ tests/phpunit/data/media/landscape-plain.jpg | Bin 0 -> 38771 bytes tests/phpunit/data/media/nonanimated.gif | Bin 0 -> 200 bytes tests/phpunit/data/media/portrait-rotated.jpg | Bin 0 -> 38577 bytes tests/phpunit/data/media/rgb-na-png.png | Bin 0 -> 593 bytes tests/phpunit/data/media/rgb-png.png | Bin 0 -> 663 bytes tests/phpunit/data/media/test.jpg | Bin 0 -> 437 bytes tests/phpunit/data/media/test.tiff | Bin 0 -> 566 bytes tests/phpunit/data/media/xmp.png | Bin 0 -> 582 bytes tests/phpunit/data/xmp/1.result.php | 8 + tests/phpunit/data/xmp/1.xmp | 11 + tests/phpunit/data/xmp/2.result.php | 8 + tests/phpunit/data/xmp/2.xmp | 12 + tests/phpunit/data/xmp/3-invalid.result.php | 7 + tests/phpunit/data/xmp/3-invalid.xmp | 31 ++ tests/phpunit/data/xmp/3.result.php | 8 + tests/phpunit/data/xmp/3.xmp | 29 ++ tests/phpunit/data/xmp/4.result.php | 7 + tests/phpunit/data/xmp/4.xmp | 22 + tests/phpunit/data/xmp/5.result.php | 7 + tests/phpunit/data/xmp/5.xmp | 16 + tests/phpunit/data/xmp/6.result.php | 8 + tests/phpunit/data/xmp/6.xmp | 18 + tests/phpunit/data/xmp/7.result.php | 52 ++ tests/phpunit/data/xmp/7.xmp | 67 +++ tests/phpunit/data/xmp/README | 3 + tests/phpunit/data/xmp/bag-for-seq.result.php | 10 + tests/phpunit/data/xmp/bag-for-seq.xmp | 1 + tests/phpunit/data/xmp/flash.result.php | 8 + tests/phpunit/data/xmp/flash.xmp | 11 + tests/phpunit/data/xmp/gps.result.php | 11 + tests/phpunit/data/xmp/gps.xmp | 17 + .../data/xmp/invalid-child-not-struct.result.php | 7 + .../phpunit/data/xmp/invalid-child-not-struct.xmp | 12 + tests/phpunit/data/xmp/no-namespace.result.php | 7 + tests/phpunit/data/xmp/no-namespace.xmp | 11 + .../data/xmp/no-recognized-props.result.php | 2 + tests/phpunit/data/xmp/no-recognized-props.xmp | 8 + tests/phpunit/data/xmp/utf16BE.result.php | 12 + tests/phpunit/data/xmp/utf16BE.xmp | Bin 0 -> 930 bytes tests/phpunit/data/xmp/utf16LE.result.php | 12 + tests/phpunit/data/xmp/utf16LE.xmp | Bin 0 -> 930 bytes tests/phpunit/data/xmp/utf32BE.result.php | 12 + tests/phpunit/data/xmp/utf32BE.xmp | Bin 0 -> 1856 bytes tests/phpunit/data/xmp/utf32LE.result.php | 12 + tests/phpunit/data/xmp/utf32LE.xmp | Bin 0 -> 1856 bytes tests/phpunit/data/xmp/xmpExt.result.php | 8 + tests/phpunit/data/xmp/xmpExt.xmp | 13 + tests/phpunit/data/xmp/xmpExt2.xmp | 8 + tests/phpunit/data/zip/cd-gap.zip | Bin 0 -> 182 bytes tests/phpunit/data/zip/cd-truncated.zip | Bin 0 -> 171 bytes tests/phpunit/data/zip/class-trailing-null.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/class-trailing-slash.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/class.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/empty.zip | Bin 0 -> 22 bytes tests/phpunit/data/zip/looks-like-zip64.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/nosig.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/split.zip | Bin 0 -> 196 bytes tests/phpunit/data/zip/trail.zip | Bin 0 -> 181 bytes tests/phpunit/data/zip/wrong-cd-start-disk.zip | Bin 0 -> 173 bytes tests/phpunit/data/zip/wrong-central-entry-sig.zip | Bin 0 -> 173 bytes 105 files changed, 3452 insertions(+) create mode 100644 tests/phpunit/data/db/mysql/functions.sql create mode 100644 tests/phpunit/data/db/postgres/functions.sql create mode 100644 tests/phpunit/data/db/sqlite/tables-1.13.sql create mode 100644 tests/phpunit/data/db/sqlite/tables-1.15.sql create mode 100644 tests/phpunit/data/db/sqlite/tables-1.16.sql create mode 100644 tests/phpunit/data/db/sqlite/tables-1.17.sql create mode 100644 tests/phpunit/data/db/sqlite/tables-1.18.sql create mode 100644 tests/phpunit/data/less/common/test.common.mixins.less create mode 100644 tests/phpunit/data/less/module/dependency.less create mode 100644 tests/phpunit/data/less/module/styles.css create mode 100644 tests/phpunit/data/less/module/styles.less create mode 100644 tests/phpunit/data/media/1bit-png.png create mode 100644 tests/phpunit/data/media/80x60-2layers.xcf create mode 100644 tests/phpunit/data/media/80x60-Greyscale.xcf create mode 100644 tests/phpunit/data/media/80x60-RGB.xcf create mode 100644 tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png create mode 100644 tests/phpunit/data/media/Gtk-media-play-ltr.svg create mode 100644 tests/phpunit/data/media/Png-native-test.png create mode 100644 tests/phpunit/data/media/QA_icon.svg create mode 100644 tests/phpunit/data/media/README create mode 100644 tests/phpunit/data/media/Toll_Texas_1.svg create mode 100644 tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg create mode 100644 tests/phpunit/data/media/Wikimedia-logo.svg create mode 100644 tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg create mode 100644 tests/phpunit/data/media/animated-xmp.gif create mode 100644 tests/phpunit/data/media/animated.gif create mode 100644 tests/phpunit/data/media/broken_exif_date.jpg create mode 100644 tests/phpunit/data/media/exif-gps.jpg create mode 100644 tests/phpunit/data/media/exif-user-comment.jpg create mode 100644 tests/phpunit/data/media/greyscale-na-png.png create mode 100644 tests/phpunit/data/media/greyscale-png.png create mode 100644 tests/phpunit/data/media/iptc-invalid-psir.jpg create mode 100644 tests/phpunit/data/media/iptc-timetest-invalid.jpg create mode 100644 tests/phpunit/data/media/iptc-timetest.jpg create mode 100644 tests/phpunit/data/media/jpeg-comment-binary.jpg create mode 100644 tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg create mode 100644 tests/phpunit/data/media/jpeg-comment-multiple.jpg create mode 100644 tests/phpunit/data/media/jpeg-comment-utf.jpg create mode 100644 tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg create mode 100644 tests/phpunit/data/media/jpeg-iptc-good-hash.jpg create mode 100644 tests/phpunit/data/media/jpeg-padding-even.jpg create mode 100644 tests/phpunit/data/media/jpeg-padding-odd.jpg create mode 100644 tests/phpunit/data/media/jpeg-xmp-alt.jpg create mode 100644 tests/phpunit/data/media/jpeg-xmp-psir.jpg create mode 100644 tests/phpunit/data/media/jpeg-xmp-psir.xmp create mode 100644 tests/phpunit/data/media/landscape-plain.jpg create mode 100644 tests/phpunit/data/media/nonanimated.gif create mode 100644 tests/phpunit/data/media/portrait-rotated.jpg create mode 100644 tests/phpunit/data/media/rgb-na-png.png create mode 100644 tests/phpunit/data/media/rgb-png.png create mode 100644 tests/phpunit/data/media/test.jpg create mode 100644 tests/phpunit/data/media/test.tiff create mode 100644 tests/phpunit/data/media/xmp.png create mode 100644 tests/phpunit/data/xmp/1.result.php create mode 100644 tests/phpunit/data/xmp/1.xmp create mode 100644 tests/phpunit/data/xmp/2.result.php create mode 100644 tests/phpunit/data/xmp/2.xmp create mode 100644 tests/phpunit/data/xmp/3-invalid.result.php create mode 100644 tests/phpunit/data/xmp/3-invalid.xmp create mode 100644 tests/phpunit/data/xmp/3.result.php create mode 100644 tests/phpunit/data/xmp/3.xmp create mode 100644 tests/phpunit/data/xmp/4.result.php create mode 100644 tests/phpunit/data/xmp/4.xmp create mode 100644 tests/phpunit/data/xmp/5.result.php create mode 100644 tests/phpunit/data/xmp/5.xmp create mode 100644 tests/phpunit/data/xmp/6.result.php create mode 100644 tests/phpunit/data/xmp/6.xmp create mode 100644 tests/phpunit/data/xmp/7.result.php create mode 100644 tests/phpunit/data/xmp/7.xmp create mode 100644 tests/phpunit/data/xmp/README create mode 100644 tests/phpunit/data/xmp/bag-for-seq.result.php create mode 100644 tests/phpunit/data/xmp/bag-for-seq.xmp create mode 100644 tests/phpunit/data/xmp/flash.result.php create mode 100644 tests/phpunit/data/xmp/flash.xmp create mode 100644 tests/phpunit/data/xmp/gps.result.php create mode 100644 tests/phpunit/data/xmp/gps.xmp create mode 100644 tests/phpunit/data/xmp/invalid-child-not-struct.result.php create mode 100644 tests/phpunit/data/xmp/invalid-child-not-struct.xmp create mode 100644 tests/phpunit/data/xmp/no-namespace.result.php create mode 100644 tests/phpunit/data/xmp/no-namespace.xmp create mode 100644 tests/phpunit/data/xmp/no-recognized-props.result.php create mode 100644 tests/phpunit/data/xmp/no-recognized-props.xmp create mode 100644 tests/phpunit/data/xmp/utf16BE.result.php create mode 100644 tests/phpunit/data/xmp/utf16BE.xmp create mode 100644 tests/phpunit/data/xmp/utf16LE.result.php create mode 100644 tests/phpunit/data/xmp/utf16LE.xmp create mode 100644 tests/phpunit/data/xmp/utf32BE.result.php create mode 100644 tests/phpunit/data/xmp/utf32BE.xmp create mode 100644 tests/phpunit/data/xmp/utf32LE.result.php create mode 100644 tests/phpunit/data/xmp/utf32LE.xmp create mode 100644 tests/phpunit/data/xmp/xmpExt.result.php create mode 100644 tests/phpunit/data/xmp/xmpExt.xmp create mode 100644 tests/phpunit/data/xmp/xmpExt2.xmp create mode 100644 tests/phpunit/data/zip/cd-gap.zip create mode 100644 tests/phpunit/data/zip/cd-truncated.zip create mode 100644 tests/phpunit/data/zip/class-trailing-null.zip create mode 100644 tests/phpunit/data/zip/class-trailing-slash.zip create mode 100644 tests/phpunit/data/zip/class.zip create mode 100644 tests/phpunit/data/zip/empty.zip create mode 100644 tests/phpunit/data/zip/looks-like-zip64.zip create mode 100644 tests/phpunit/data/zip/nosig.zip create mode 100644 tests/phpunit/data/zip/split.zip create mode 100644 tests/phpunit/data/zip/trail.zip create mode 100644 tests/phpunit/data/zip/wrong-cd-start-disk.zip create mode 100644 tests/phpunit/data/zip/wrong-central-entry-sig.zip (limited to 'tests/phpunit/data') diff --git a/tests/phpunit/data/db/mysql/functions.sql b/tests/phpunit/data/db/mysql/functions.sql new file mode 100644 index 00000000..9e5e470f --- /dev/null +++ b/tests/phpunit/data/db/mysql/functions.sql @@ -0,0 +1,12 @@ +-- MySQL test file for DatabaseTest::testStoredFunctions() + +DELIMITER // + +CREATE FUNCTION mw_test_function() +RETURNS int DETERMINISTIC +BEGIN + SET @foo = 21; + RETURN @foo * 2; +END// + +DELIMITER // diff --git a/tests/phpunit/data/db/postgres/functions.sql b/tests/phpunit/data/db/postgres/functions.sql new file mode 100644 index 00000000..3086d4d5 --- /dev/null +++ b/tests/phpunit/data/db/postgres/functions.sql @@ -0,0 +1,12 @@ +-- Postgres test file for DatabaseTest::testStoredFunctions() + +CREATE FUNCTION mw_test_function() +RETURNS INTEGER +LANGUAGE plpgsql AS +$mw$ +DECLARE foo INTEGER; +BEGIN + foo := 21; + RETURN foo * 2; +END +$mw$; diff --git a/tests/phpunit/data/db/sqlite/tables-1.13.sql b/tests/phpunit/data/db/sqlite/tables-1.13.sql new file mode 100644 index 00000000..66847ab1 --- /dev/null +++ b/tests/phpunit/data/db/sqlite/tables-1.13.sql @@ -0,0 +1,342 @@ +-- This is a copy of SQLite schema from MediaWiki 1.13 used for updater testing + +CREATE TABLE /*$wgDBprefix*/user ( + user_id INTEGER PRIMARY KEY AUTOINCREMENT, + user_name varchar(255) default '', + user_real_name varchar(255) default '', + user_password tinyblob , + user_newpassword tinyblob , + user_newpass_time BLOB, + user_email tinytext , + user_options blob , + user_touched BLOB default '', + user_token BLOB default '', + user_email_authenticated BLOB, + user_email_token BLOB, + user_email_token_expires BLOB, + user_registration BLOB, + user_editcount int) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/user_groups ( + ug_user INTEGER default '0', + ug_group varBLOB default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/user_newtalk ( + user_id INTEGER default '0', + user_ip varBLOB default '', + user_last_timestamp BLOB default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/page ( + page_id INTEGER PRIMARY KEY AUTOINCREMENT, + page_namespace INTEGER , + page_title varchar(255) , + page_restrictions tinyblob , + page_counter bigint default '0', + page_is_redirect tinyint default '0', + page_is_new tinyint default '0', + page_random real , + page_touched BLOB default '', + page_latest INTEGER , + page_len INTEGER ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/revision ( + rev_id INTEGER PRIMARY KEY AUTOINCREMENT, + rev_page INTEGER , + rev_text_id INTEGER , + rev_comment tinyblob , + rev_user INTEGER default '0', + rev_user_text varchar(255) default '', + rev_timestamp BLOB default '', + rev_minor_edit tinyint default '0', + rev_deleted tinyint default '0', + rev_len int, + rev_parent_id INTEGER default NULL) /*$wgDBTableOptions*/ ; + +CREATE TABLE /*$wgDBprefix*/text ( + old_id INTEGER PRIMARY KEY AUTOINCREMENT, + old_text mediumblob , + old_flags tinyblob ) /*$wgDBTableOptions*/ ; + +CREATE TABLE /*$wgDBprefix*/archive ( + ar_namespace INTEGER default '0', + ar_title varchar(255) default '', + ar_text mediumblob , + ar_comment tinyblob , + ar_user INTEGER default '0', + ar_user_text varchar(255) , + ar_timestamp BLOB default '', + ar_minor_edit tinyint default '0', + ar_flags tinyblob , + ar_rev_id int, + ar_text_id int, + ar_deleted tinyint default '0', + ar_len int, + ar_page_id int, + ar_parent_id INTEGER default NULL) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/pagelinks ( + pl_from INTEGER default '0', + pl_namespace INTEGER default '0', + pl_title varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/templatelinks ( + tl_from INTEGER default '0', + tl_namespace INTEGER default '0', + tl_title varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/imagelinks ( + il_from INTEGER default '0', + il_to varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/categorylinks ( + cl_from INTEGER default '0', + cl_to varchar(255) default '', + cl_sortkey varchar(70) default '', + cl_timestamp timestamp ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/category ( + cat_id INTEGER PRIMARY KEY AUTOINCREMENT, + cat_title varchar(255) , + cat_pages INTEGER signed default 0, + cat_subcats INTEGER signed default 0, + cat_files INTEGER signed default 0, + cat_hidden tinyint default 0) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/externallinks ( + el_from INTEGER default '0', + el_to blob , + el_index blob ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/langlinks ( + ll_from INTEGER default '0', + ll_lang varBLOB default '', + ll_title varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/site_stats ( + ss_row_id INTEGER , + ss_total_views bigint default '0', + ss_total_edits bigint default '0', + ss_good_articles bigint default '0', + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_admins INTEGER default '-1', + ss_images INTEGER default '0') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/hitcounter ( + hc_id INTEGER +) ; + +CREATE TABLE /*$wgDBprefix*/ipblocks ( + ipb_id INTEGER PRIMARY KEY AUTOINCREMENT, + ipb_address tinyblob , + ipb_user INTEGER default '0', + ipb_by INTEGER default '0', + ipb_by_text varchar(255) default '', + ipb_reason tinyblob , + ipb_timestamp BLOB default '', + ipb_auto bool default 0, + ipb_anon_only bool default 0, + ipb_create_account bool default 1, + ipb_enable_autoblock bool default '1', + ipb_expiry varBLOB default '', + ipb_range_start tinyblob , + ipb_range_end tinyblob , + ipb_deleted bool default 0, + ipb_block_email bool default 0) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/image ( + img_name varchar(255) default '', + img_size INTEGER default '0', + img_width INTEGER default '0', + img_height INTEGER default '0', + img_metadata mediumblob , + img_bits INTEGER default '0', + img_media_type TEXT default NULL, + img_major_mime TEXT default "unknown", + img_minor_mime varBLOB default "unknown", + img_description tinyblob , + img_user INTEGER default '0', + img_user_text varchar(255) , + img_timestamp varBLOB default '', + img_sha1 varBLOB default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/oldimage ( + oi_name varchar(255) default '', + oi_archive_name varchar(255) default '', + oi_size INTEGER default 0, + oi_width INTEGER default 0, + oi_height INTEGER default 0, + oi_bits INTEGER default 0, + oi_description tinyblob , + oi_user INTEGER default '0', + oi_user_text varchar(255) , + oi_timestamp BLOB default '', + oi_metadata mediumblob , + oi_media_type TEXT default NULL, + oi_major_mime TEXT default "unknown", + oi_minor_mime varBLOB default "unknown", + oi_deleted tinyint default '0', + oi_sha1 varBLOB default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/filearchive ( + fa_id INTEGER PRIMARY KEY AUTOINCREMENT, + fa_name varchar(255) default '', + fa_archive_name varchar(255) default '', + fa_storage_group varBLOB, + fa_storage_key varBLOB default '', + fa_deleted_user int, + fa_deleted_timestamp BLOB default '', + fa_deleted_reason text, + fa_size INTEGER default '0', + fa_width INTEGER default '0', + fa_height INTEGER default '0', + fa_metadata mediumblob, + fa_bits INTEGER default '0', + fa_media_type TEXT default NULL, + fa_major_mime TEXT default "unknown", + fa_minor_mime varBLOB default "unknown", + fa_description tinyblob, + fa_user INTEGER default '0', + fa_user_text varchar(255) , + fa_timestamp BLOB default '', + fa_deleted tinyint default '0') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/recentchanges ( + rc_id INTEGER PRIMARY KEY AUTOINCREMENT, + rc_timestamp varBLOB default '', + rc_cur_time varBLOB default '', + rc_user INTEGER default '0', + rc_user_text varchar(255) , + rc_namespace INTEGER default '0', + rc_title varchar(255) default '', + rc_comment varchar(255) default '', + rc_minor tinyint default '0', + rc_bot tinyint default '0', + rc_new tinyint default '0', + rc_cur_id INTEGER default '0', + rc_this_oldid INTEGER default '0', + rc_last_oldid INTEGER default '0', + rc_type tinyint default '0', + rc_moved_to_ns tinyint default '0', + rc_moved_to_title varchar(255) default '', + rc_patrolled tinyint default '0', + rc_ip varBLOB default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint default '0', + rc_logid INTEGER default '0', + rc_log_type varBLOB NULL default NULL, + rc_log_action varBLOB NULL default NULL, + rc_params blob NULL) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/watchlist ( + wl_user INTEGER , + wl_namespace INTEGER default '0', + wl_title varchar(255) default '', + wl_notificationtimestamp varBLOB) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/math ( + math_inputhash varBLOB , + math_outputhash varBLOB , + math_html_conservativeness tinyint , + math_html text, + math_mathml text) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/searchindex ( + si_page INTEGER , + si_title varchar(255) default '', + si_text mediumtext ) ; + +CREATE TABLE /*$wgDBprefix*/interwiki ( + iw_prefix varchar(32) , + iw_url blob , + iw_local bool , + iw_trans tinyint default 0) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/querycache ( + qc_type varBLOB , + qc_value INTEGER default '0', + qc_namespace INTEGER default '0', + qc_title varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/objectcache ( + keyname varBLOB default '', + value mediumblob, + exptime datetime) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/transcache ( + tc_url varBLOB , + tc_contents text, + tc_time INTEGER ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/logging ( + log_id INTEGER PRIMARY KEY AUTOINCREMENT, + log_type varBLOB default '', + log_action varBLOB default '', + log_timestamp BLOB default '19700101000000', + log_user INTEGER default 0, + log_namespace INTEGER default 0, + log_title varchar(255) default '', + log_comment varchar(255) default '', + log_params blob , + log_deleted tinyint default '0') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/trackbacks ( + tb_id INTEGER PRIMARY KEY AUTOINCREMENT, + tb_page INTEGER REFERENCES /*$wgDBprefix*/page(page_id) ON DELETE CASCADE, + tb_title varchar(255) , + tb_url blob , + tb_ex text, + tb_name varchar(255)) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/job ( + job_id INTEGER PRIMARY KEY AUTOINCREMENT, + job_cmd varBLOB default '', + job_namespace INTEGER , + job_title varchar(255) , + job_params blob ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/querycache_info ( + qci_type varBLOB default '', + qci_timestamp BLOB default '19700101000000') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/redirect ( + rd_from INTEGER default '0', + rd_namespace INTEGER default '0', + rd_title varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/querycachetwo ( + qcc_type varBLOB , + qcc_value INTEGER default '0', + qcc_namespace INTEGER default '0', + qcc_title varchar(255) default '', + qcc_namespacetwo INTEGER default '0', + qcc_titletwo varchar(255) default '') /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/page_restrictions ( + pr_page INTEGER , + pr_type varBLOB , + pr_level varBLOB , + pr_cascade tinyint , + pr_user INTEGER NULL, + pr_expiry varBLOB NULL, + pr_id INTEGER PRIMARY KEY AUTOINCREMENT) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/protected_titles ( + pt_namespace INTEGER , + pt_title varchar(255) , + pt_user INTEGER , + pt_reason tinyblob, + pt_timestamp BLOB , + pt_expiry varBLOB default '', + pt_create_perm varBLOB ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/page_props ( + pp_page INTEGER , + pp_propname varBLOB , + pp_value blob ) /*$wgDBTableOptions*/; + +CREATE TABLE /*$wgDBprefix*/updatelog ( + ul_key varchar(255) ) /*$wgDBTableOptions*/; + + diff --git a/tests/phpunit/data/db/sqlite/tables-1.15.sql b/tests/phpunit/data/db/sqlite/tables-1.15.sql new file mode 100644 index 00000000..6b3a628e --- /dev/null +++ b/tests/phpunit/data/db/sqlite/tables-1.15.sql @@ -0,0 +1,454 @@ +-- This is a copy of MediaWiki 1.15 schema shared by MySQL and SQLite. +-- It is used for updater testing. Comments are stripped to decrease +-- file size, as we don't need to maintain it. + +CREATE TABLE /*_*/user ( + user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_name varchar(255) binary NOT NULL default '', + user_real_name varchar(255) binary NOT NULL default '', + user_password tinyblob NOT NULL, + user_newpassword tinyblob NOT NULL, + user_newpass_time binary(14), + user_email tinytext NOT NULL, + user_options blob NOT NULL, + user_touched binary(14) NOT NULL default '', + user_token binary(32) NOT NULL default '', + user_email_authenticated binary(14), + user_email_token binary(32), + user_email_token_expires binary(14), + user_registration binary(14), + user_editcount int +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); +CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); +CREATE TABLE /*_*/user_groups ( + ug_user int unsigned NOT NULL default 0, + ug_group varbinary(16) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); +CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); +CREATE TABLE /*_*/user_newtalk ( + user_id int NOT NULL default 0, + user_ip varbinary(40) NOT NULL default '', + user_last_timestamp binary(14) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id); +CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip); +CREATE TABLE /*_*/page ( + page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + page_namespace int NOT NULL, + page_title varchar(255) binary NOT NULL, + page_restrictions tinyblob NOT NULL, + page_counter bigint unsigned NOT NULL default 0, + page_is_redirect tinyint unsigned NOT NULL default 0, + page_is_new tinyint unsigned NOT NULL default 0, + page_random real unsigned NOT NULL, + page_touched binary(14) NOT NULL default '', + page_latest int unsigned NOT NULL, + page_len int unsigned NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); +CREATE INDEX /*i*/page_random ON /*_*/page (page_random); +CREATE INDEX /*i*/page_len ON /*_*/page (page_len); +CREATE TABLE /*_*/revision ( + rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + rev_page int unsigned NOT NULL, + rev_text_id int unsigned NOT NULL, + rev_comment tinyblob NOT NULL, + rev_user int unsigned NOT NULL default 0, + rev_user_text varchar(255) binary NOT NULL default '', + rev_timestamp binary(14) NOT NULL default '', + rev_minor_edit tinyint unsigned NOT NULL default 0, + rev_deleted tinyint unsigned NOT NULL default 0, + rev_len int unsigned, + rev_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; +CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id); +CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp); +CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp); +CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp); +CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp); +CREATE TABLE /*_*/text ( + old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + old_text mediumblob NOT NULL, + old_flags tinyblob NOT NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240; +CREATE TABLE /*_*/archive ( + ar_namespace int NOT NULL default 0, + ar_title varchar(255) binary NOT NULL default '', + ar_text mediumblob NOT NULL, + ar_comment tinyblob NOT NULL, + ar_user int unsigned NOT NULL default 0, + ar_user_text varchar(255) binary NOT NULL, + ar_timestamp binary(14) NOT NULL default '', + ar_minor_edit tinyint NOT NULL default 0, + ar_flags tinyblob NOT NULL, + ar_rev_id int unsigned, + ar_text_id int unsigned, + ar_deleted tinyint unsigned NOT NULL default 0, + ar_len int unsigned, + ar_page_id int unsigned, + ar_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp); +CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp); +CREATE TABLE /*_*/pagelinks ( + pl_from int unsigned NOT NULL default 0, + pl_namespace int NOT NULL default 0, + pl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); +CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE TABLE /*_*/templatelinks ( + tl_from int unsigned NOT NULL default 0, + tl_namespace int NOT NULL default 0, + tl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); +CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE TABLE /*_*/imagelinks ( + il_from int unsigned NOT NULL default 0, + il_to varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); +CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE TABLE /*_*/categorylinks ( + cl_from int unsigned NOT NULL default 0, + cl_to varchar(255) binary NOT NULL default '', + cl_sortkey varchar(70) binary NOT NULL default '', + cl_timestamp timestamp NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to); +CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from); +CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp); +CREATE TABLE /*_*/category ( + cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + cat_title varchar(255) binary NOT NULL, + cat_pages int signed NOT NULL default 0, + cat_subcats int signed NOT NULL default 0, + cat_files int signed NOT NULL default 0, + cat_hidden tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); +CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); +CREATE TABLE /*_*/externallinks ( + el_from int unsigned NOT NULL default 0, + el_to blob NOT NULL, + el_index blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); +CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); +CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); +CREATE TABLE /*_*/langlinks ( + ll_from int unsigned NOT NULL default 0, + + ll_lang varbinary(20) NOT NULL default '', + ll_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); +CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); +CREATE TABLE /*_*/site_stats ( + ss_row_id int unsigned NOT NULL, + ss_total_views bigint unsigned default 0, + ss_total_edits bigint unsigned default 0, + ss_good_articles bigint unsigned default 0, + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_active_users bigint default '-1', + ss_admins int default '-1', + ss_images int default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id); +CREATE TABLE /*_*/hitcounter ( + hc_id int unsigned NOT NULL +) ENGINE=HEAP MAX_ROWS=25000; +CREATE TABLE /*_*/ipblocks ( + ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + ipb_address tinyblob NOT NULL, + ipb_user int unsigned NOT NULL default 0, + ipb_by int unsigned NOT NULL default 0, + ipb_by_text varchar(255) binary NOT NULL default '', + ipb_reason tinyblob NOT NULL, + ipb_timestamp binary(14) NOT NULL default '', + ipb_auto bool NOT NULL default 0, + ipb_anon_only bool NOT NULL default 0, + ipb_create_account bool NOT NULL default 1, + ipb_enable_autoblock bool NOT NULL default '1', + ipb_expiry varbinary(14) NOT NULL default '', + ipb_range_start tinyblob NOT NULL, + ipb_range_end tinyblob NOT NULL, + ipb_deleted bool NOT NULL default 0, + ipb_block_email bool NOT NULL default 0, + ipb_allow_usertalk bool NOT NULL default 0 +) /*$wgDBTableOptions*/; + +CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only); +CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user); +CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8)); +CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp); +CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry); +CREATE TABLE /*_*/image ( + img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, + img_size int unsigned NOT NULL default 0, + img_width int NOT NULL default 0, + img_height int NOT NULL default 0, + img_metadata mediumblob NOT NULL, + img_bits int NOT NULL default 0, + img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + img_minor_mime varbinary(32) NOT NULL default "unknown", + img_description tinyblob NOT NULL, + img_user int unsigned NOT NULL default 0, + img_user_text varchar(255) binary NOT NULL, + img_timestamp varbinary(14) NOT NULL default '', + img_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp); +CREATE INDEX /*i*/img_size ON /*_*/image (img_size); +CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp); +CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1); +CREATE TABLE /*_*/oldimage ( + oi_name varchar(255) binary NOT NULL default '', + oi_archive_name varchar(255) binary NOT NULL default '', + oi_size int unsigned NOT NULL default 0, + oi_width int NOT NULL default 0, + oi_height int NOT NULL default 0, + oi_bits int NOT NULL default 0, + oi_description tinyblob NOT NULL, + oi_user int unsigned NOT NULL default 0, + oi_user_text varchar(255) binary NOT NULL, + oi_timestamp binary(14) NOT NULL default '', + oi_metadata mediumblob NOT NULL, + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + oi_minor_mime varbinary(32) NOT NULL default "unknown", + oi_deleted tinyint unsigned NOT NULL default 0, + oi_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp); +CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp); +CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14)); +CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1); +CREATE TABLE /*_*/filearchive ( + fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + fa_name varchar(255) binary NOT NULL default '', + fa_archive_name varchar(255) binary default '', + fa_storage_group varbinary(16), + fa_storage_key varbinary(64) default '', + fa_deleted_user int, + fa_deleted_timestamp binary(14) default '', + fa_deleted_reason text, + fa_size int unsigned default 0, + fa_width int default 0, + fa_height int default 0, + fa_metadata mediumblob, + fa_bits int default 0, + fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", + fa_minor_mime varbinary(32) default "unknown", + fa_description tinyblob, + fa_user int unsigned default 0, + fa_user_text varchar(255) binary, + fa_timestamp binary(14) default '', + fa_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); +CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); +CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); +CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp); +CREATE TABLE /*_*/recentchanges ( + rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + rc_timestamp varbinary(14) NOT NULL default '', + rc_cur_time varbinary(14) NOT NULL default '', + rc_user int unsigned NOT NULL default 0, + rc_user_text varchar(255) binary NOT NULL, + rc_namespace int NOT NULL default 0, + rc_title varchar(255) binary NOT NULL default '', + rc_comment varchar(255) binary NOT NULL default '', + rc_minor tinyint unsigned NOT NULL default 0, + rc_bot tinyint unsigned NOT NULL default 0, + rc_new tinyint unsigned NOT NULL default 0, + rc_cur_id int unsigned NOT NULL default 0, + rc_this_oldid int unsigned NOT NULL default 0, + rc_last_oldid int unsigned NOT NULL default 0, + rc_type tinyint unsigned NOT NULL default 0, + rc_moved_to_ns tinyint unsigned NOT NULL default 0, + rc_moved_to_title varchar(255) binary NOT NULL default '', + rc_patrolled tinyint unsigned NOT NULL default 0, + rc_ip varbinary(40) NOT NULL default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint unsigned NOT NULL default 0, + rc_logid int unsigned NOT NULL default 0, + rc_log_type varbinary(255) NULL default NULL, + rc_log_action varbinary(255) NULL default NULL, + rc_params blob NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); +CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); +CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); +CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); +CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); +CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); +CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); +CREATE TABLE /*_*/watchlist ( + wl_user int unsigned NOT NULL, + wl_namespace int NOT NULL default 0, + wl_title varchar(255) binary NOT NULL default '', + wl_notificationtimestamp varbinary(14) +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); +CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); +CREATE TABLE /*_*/math ( + math_inputhash varbinary(16) NOT NULL, + math_outputhash varbinary(16) NOT NULL, + math_html_conservativeness tinyint NOT NULL, + math_html text, + math_mathml text +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash); +CREATE TABLE /*_*/searchindex ( + si_page int unsigned NOT NULL, + si_title varchar(255) NOT NULL default '', + si_text mediumtext NOT NULL +) ENGINE=MyISAM; +CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); +CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); +CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); +CREATE TABLE /*_*/interwiki ( + iw_prefix varchar(32) NOT NULL, + iw_url blob NOT NULL, + iw_local bool NOT NULL, + iw_trans tinyint NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix); +CREATE TABLE /*_*/querycache ( + qc_type varbinary(32) NOT NULL, + qc_value int unsigned NOT NULL default 0, + qc_namespace int NOT NULL default 0, + qc_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); +CREATE TABLE /*_*/objectcache ( + keyname varbinary(255) NOT NULL default '' PRIMARY KEY, + value mediumblob, + exptime datetime +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); +CREATE TABLE /*_*/transcache ( + tc_url varbinary(255) NOT NULL, + tc_contents text, + tc_time int NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url); +CREATE TABLE /*_*/logging ( + log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + log_type varbinary(10) NOT NULL default '', + log_action varbinary(10) NOT NULL default '', + log_timestamp binary(14) NOT NULL default '19700101000000', + log_user int unsigned NOT NULL default 0, + log_namespace int NOT NULL default 0, + log_title varchar(255) binary NOT NULL default '', + log_comment varchar(255) NOT NULL default '', + log_params blob NOT NULL, + log_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp); +CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp); +CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp); +CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp); +CREATE TABLE /*_*/trackbacks ( + tb_id int PRIMARY KEY AUTO_INCREMENT, + tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE, + tb_title varchar(255) NOT NULL, + tb_url blob NOT NULL, + tb_ex text, + tb_name varchar(255) +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page); +CREATE TABLE /*_*/job ( + job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_cmd varbinary(60) NOT NULL default '', + job_namespace int NOT NULL, + job_title varchar(255) binary NOT NULL, + job_params blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title); +CREATE TABLE /*_*/querycache_info ( + qci_type varbinary(32) NOT NULL default '', + qci_timestamp binary(14) NOT NULL default '19700101000000' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type); +CREATE TABLE /*_*/redirect ( + rd_from int unsigned NOT NULL default 0 PRIMARY KEY, + rd_namespace int NOT NULL default 0, + rd_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); +CREATE TABLE /*_*/querycachetwo ( + qcc_type varbinary(32) NOT NULL, + qcc_value int unsigned NOT NULL default 0, + qcc_namespace int NOT NULL default 0, + qcc_title varchar(255) binary NOT NULL default '', + qcc_namespacetwo int NOT NULL default 0, + qcc_titletwo varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); +CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); +CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); +CREATE TABLE /*_*/page_restrictions ( + pr_page int NOT NULL, + pr_type varbinary(60) NOT NULL, + pr_level varbinary(60) NOT NULL, + pr_cascade tinyint NOT NULL, + pr_user int NULL, + pr_expiry varbinary(14) NULL, + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); +CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level); +CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level); +CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); +CREATE TABLE /*_*/protected_titles ( + pt_namespace int NOT NULL, + pt_title varchar(255) binary NOT NULL, + pt_user int unsigned NOT NULL, + pt_reason tinyblob, + pt_timestamp binary(14) NOT NULL, + pt_expiry varbinary(14) NOT NULL default '', + pt_create_perm varbinary(60) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title); +CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp); +CREATE TABLE /*_*/page_props ( + pp_page int NOT NULL, + pp_propname varbinary(60) NOT NULL, + pp_value blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname); +CREATE TABLE /*_*/updatelog ( + ul_key varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/change_tag ( + ct_rc_id int NULL, + ct_log_id int NULL, + ct_rev_id int NULL, + ct_tag varchar(255) NOT NULL, + ct_params blob NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); +CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); +CREATE TABLE /*_*/tag_summary ( + ts_rc_id int NULL, + ts_log_id int NULL, + ts_rev_id int NULL, + ts_tags blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); +CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); +CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); +CREATE TABLE /*_*/valid_tag ( + vt_tag varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; diff --git a/tests/phpunit/data/db/sqlite/tables-1.16.sql b/tests/phpunit/data/db/sqlite/tables-1.16.sql new file mode 100644 index 00000000..7e8f30ec --- /dev/null +++ b/tests/phpunit/data/db/sqlite/tables-1.16.sql @@ -0,0 +1,478 @@ +-- This is a copy of MediaWiki 1.16 schema shared by MySQL and SQLite. +-- It is used for updater testing. Comments are stripped to decrease +-- file size, as we don't need to maintain it. + +CREATE TABLE /*_*/user ( + user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_name varchar(255) binary NOT NULL default '', + user_real_name varchar(255) binary NOT NULL default '', + user_password tinyblob NOT NULL, + user_newpassword tinyblob NOT NULL, + user_newpass_time binary(14), + user_email tinytext NOT NULL, + user_options blob NOT NULL, + user_touched binary(14) NOT NULL default '', + user_token binary(32) NOT NULL default '', + user_email_authenticated binary(14), + user_email_token binary(32), + user_email_token_expires binary(14), + user_registration binary(14), + user_editcount int +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); +CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); +CREATE TABLE /*_*/user_groups ( + ug_user int unsigned NOT NULL default 0, + ug_group varbinary(16) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); +CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); +CREATE TABLE /*_*/user_newtalk ( + user_id int NOT NULL default 0, + user_ip varbinary(40) NOT NULL default '', + user_last_timestamp binary(14) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id); +CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip); +CREATE TABLE /*_*/user_properties ( + up_user int NOT NULL, + up_property varbinary(32) NOT NULL, + up_value blob +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property); +CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property); +CREATE TABLE /*_*/page ( + page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + page_namespace int NOT NULL, + page_title varchar(255) binary NOT NULL, + page_restrictions tinyblob NOT NULL, + page_counter bigint unsigned NOT NULL default 0, + page_is_redirect tinyint unsigned NOT NULL default 0, + page_is_new tinyint unsigned NOT NULL default 0, + page_random real unsigned NOT NULL, + page_touched binary(14) NOT NULL default '', + page_latest int unsigned NOT NULL, + page_len int unsigned NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); +CREATE INDEX /*i*/page_random ON /*_*/page (page_random); +CREATE INDEX /*i*/page_len ON /*_*/page (page_len); +CREATE TABLE /*_*/revision ( + rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + rev_page int unsigned NOT NULL, + rev_text_id int unsigned NOT NULL, + rev_comment tinyblob NOT NULL, + rev_user int unsigned NOT NULL default 0, + rev_user_text varchar(255) binary NOT NULL default '', + rev_timestamp binary(14) NOT NULL default '', + rev_minor_edit tinyint unsigned NOT NULL default 0, + rev_deleted tinyint unsigned NOT NULL default 0, + rev_len int unsigned, + rev_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; +CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id); +CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp); +CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp); +CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp); +CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp); +CREATE TABLE /*_*/text ( + old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + old_text mediumblob NOT NULL, + old_flags tinyblob NOT NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240; +CREATE TABLE /*_*/archive ( + ar_namespace int NOT NULL default 0, + ar_title varchar(255) binary NOT NULL default '', + ar_text mediumblob NOT NULL, + ar_comment tinyblob NOT NULL, + ar_user int unsigned NOT NULL default 0, + ar_user_text varchar(255) binary NOT NULL, + ar_timestamp binary(14) NOT NULL default '', + ar_minor_edit tinyint NOT NULL default 0, + ar_flags tinyblob NOT NULL, + ar_rev_id int unsigned, + ar_text_id int unsigned, + ar_deleted tinyint unsigned NOT NULL default 0, + ar_len int unsigned, + ar_page_id int unsigned, + ar_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp); +CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp); +CREATE TABLE /*_*/pagelinks ( + pl_from int unsigned NOT NULL default 0, + pl_namespace int NOT NULL default 0, + pl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); +CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE TABLE /*_*/templatelinks ( + tl_from int unsigned NOT NULL default 0, + tl_namespace int NOT NULL default 0, + tl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); +CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE TABLE /*_*/imagelinks ( + il_from int unsigned NOT NULL default 0, + il_to varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); +CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE TABLE /*_*/categorylinks ( + cl_from int unsigned NOT NULL default 0, + cl_to varchar(255) binary NOT NULL default '', + cl_sortkey varchar(70) binary NOT NULL default '', + cl_timestamp timestamp NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to); +CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from); +CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp); +CREATE TABLE /*_*/category ( + cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + cat_title varchar(255) binary NOT NULL, + cat_pages int signed NOT NULL default 0, + cat_subcats int signed NOT NULL default 0, + cat_files int signed NOT NULL default 0, + cat_hidden tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); +CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); +CREATE TABLE /*_*/externallinks ( + el_from int unsigned NOT NULL default 0, + el_to blob NOT NULL, + el_index blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); +CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); +CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); +CREATE TABLE /*_*/langlinks ( + ll_from int unsigned NOT NULL default 0, + ll_lang varbinary(20) NOT NULL default '', + ll_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); +CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); +CREATE TABLE /*_*/site_stats ( + ss_row_id int unsigned NOT NULL, + ss_total_views bigint unsigned default 0, + ss_total_edits bigint unsigned default 0, + ss_good_articles bigint unsigned default 0, + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_active_users bigint default '-1', + ss_admins int default '-1', + ss_images int default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id); +CREATE TABLE /*_*/hitcounter ( + hc_id int unsigned NOT NULL +) ENGINE=HEAP MAX_ROWS=25000; +CREATE TABLE /*_*/ipblocks ( + ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + ipb_address tinyblob NOT NULL, + ipb_user int unsigned NOT NULL default 0, + ipb_by int unsigned NOT NULL default 0, + ipb_by_text varchar(255) binary NOT NULL default '', + ipb_reason tinyblob NOT NULL, + ipb_timestamp binary(14) NOT NULL default '', + ipb_auto bool NOT NULL default 0, + ipb_anon_only bool NOT NULL default 0, + ipb_create_account bool NOT NULL default 1, + ipb_enable_autoblock bool NOT NULL default '1', + ipb_expiry varbinary(14) NOT NULL default '', + ipb_range_start tinyblob NOT NULL, + ipb_range_end tinyblob NOT NULL, + ipb_deleted bool NOT NULL default 0, + ipb_block_email bool NOT NULL default 0, + ipb_allow_usertalk bool NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only); +CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user); +CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8)); +CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp); +CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry); +CREATE TABLE /*_*/image ( + img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, + img_size int unsigned NOT NULL default 0, + img_width int NOT NULL default 0, + img_height int NOT NULL default 0, + img_metadata mediumblob NOT NULL, + img_bits int NOT NULL default 0, + img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + img_minor_mime varbinary(100) NOT NULL default "unknown", + img_description tinyblob NOT NULL, + img_user int unsigned NOT NULL default 0, + img_user_text varchar(255) binary NOT NULL, + img_timestamp varbinary(14) NOT NULL default '', + img_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp); +CREATE INDEX /*i*/img_size ON /*_*/image (img_size); +CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp); +CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1); +CREATE TABLE /*_*/oldimage ( + oi_name varchar(255) binary NOT NULL default '', + oi_archive_name varchar(255) binary NOT NULL default '', + oi_size int unsigned NOT NULL default 0, + oi_width int NOT NULL default 0, + oi_height int NOT NULL default 0, + oi_bits int NOT NULL default 0, + oi_description tinyblob NOT NULL, + oi_user int unsigned NOT NULL default 0, + oi_user_text varchar(255) binary NOT NULL, + oi_timestamp binary(14) NOT NULL default '', + oi_metadata mediumblob NOT NULL, + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + oi_minor_mime varbinary(100) NOT NULL default "unknown", + oi_deleted tinyint unsigned NOT NULL default 0, + oi_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp); +CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp); +CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14)); +CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1); +CREATE TABLE /*_*/filearchive ( + fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + fa_name varchar(255) binary NOT NULL default '', + fa_archive_name varchar(255) binary default '', + fa_storage_group varbinary(16), + fa_storage_key varbinary(64) default '', + fa_deleted_user int, + fa_deleted_timestamp binary(14) default '', + fa_deleted_reason text, + fa_size int unsigned default 0, + fa_width int default 0, + fa_height int default 0, + fa_metadata mediumblob, + fa_bits int default 0, + fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", + fa_minor_mime varbinary(100) default "unknown", + fa_description tinyblob, + fa_user int unsigned default 0, + fa_user_text varchar(255) binary, + fa_timestamp binary(14) default '', + fa_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); +CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); +CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); +CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp); +CREATE TABLE /*_*/recentchanges ( + rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + rc_timestamp varbinary(14) NOT NULL default '', + rc_cur_time varbinary(14) NOT NULL default '', + rc_user int unsigned NOT NULL default 0, + rc_user_text varchar(255) binary NOT NULL, + rc_namespace int NOT NULL default 0, + rc_title varchar(255) binary NOT NULL default '', + rc_comment varchar(255) binary NOT NULL default '', + rc_minor tinyint unsigned NOT NULL default 0, + rc_bot tinyint unsigned NOT NULL default 0, + rc_new tinyint unsigned NOT NULL default 0, + rc_cur_id int unsigned NOT NULL default 0, + rc_this_oldid int unsigned NOT NULL default 0, + rc_last_oldid int unsigned NOT NULL default 0, + rc_type tinyint unsigned NOT NULL default 0, + rc_moved_to_ns tinyint unsigned NOT NULL default 0, + rc_moved_to_title varchar(255) binary NOT NULL default '', + rc_patrolled tinyint unsigned NOT NULL default 0, + rc_ip varbinary(40) NOT NULL default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint unsigned NOT NULL default 0, + rc_logid int unsigned NOT NULL default 0, + rc_log_type varbinary(255) NULL default NULL, + rc_log_action varbinary(255) NULL default NULL, + rc_params blob NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); +CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); +CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); +CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); +CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); +CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); +CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); +CREATE TABLE /*_*/watchlist ( + wl_user int unsigned NOT NULL, + wl_namespace int NOT NULL default 0, + wl_title varchar(255) binary NOT NULL default '', + wl_notificationtimestamp varbinary(14) +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); +CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); +CREATE TABLE /*_*/math ( + math_inputhash varbinary(16) NOT NULL, + math_outputhash varbinary(16) NOT NULL, + math_html_conservativeness tinyint NOT NULL, + math_html text, + math_mathml text +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash); +CREATE TABLE /*_*/searchindex ( + si_page int unsigned NOT NULL, + si_title varchar(255) NOT NULL default '', + si_text mediumtext NOT NULL +) ENGINE=MyISAM; +CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); +CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); +CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); +CREATE TABLE /*_*/interwiki ( + iw_prefix varchar(32) NOT NULL, + iw_url blob NOT NULL, + iw_local bool NOT NULL, + iw_trans tinyint NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix); +CREATE TABLE /*_*/querycache ( + qc_type varbinary(32) NOT NULL, + qc_value int unsigned NOT NULL default 0, + qc_namespace int NOT NULL default 0, + qc_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); +CREATE TABLE /*_*/objectcache ( + keyname varbinary(255) NOT NULL default '' PRIMARY KEY, + value mediumblob, + exptime datetime +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); +CREATE TABLE /*_*/transcache ( + tc_url varbinary(255) NOT NULL, + tc_contents text, + tc_time binary(14) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url); +CREATE TABLE /*_*/logging ( + log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + log_type varbinary(32) NOT NULL default '', + log_action varbinary(32) NOT NULL default '', + log_timestamp binary(14) NOT NULL default '19700101000000', + log_user int unsigned NOT NULL default 0, + log_user_text varchar(255) binary NOT NULL default '', + log_namespace int NOT NULL default 0, + log_title varchar(255) binary NOT NULL default '', + log_page int unsigned NULL, + log_comment varchar(255) NOT NULL default '', + log_params blob NOT NULL, + log_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp); +CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp); +CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp); +CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp); +CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); +CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp); +CREATE TABLE /*_*/log_search ( + ls_field varbinary(32) NOT NULL, + ls_value varchar(255) NOT NULL, + ls_log_id int unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id); +CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); +CREATE TABLE /*_*/trackbacks ( + tb_id int PRIMARY KEY AUTO_INCREMENT, + tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE, + tb_title varchar(255) NOT NULL, + tb_url blob NOT NULL, + tb_ex text, + tb_name varchar(255) +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page); +CREATE TABLE /*_*/job ( + job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_cmd varbinary(60) NOT NULL default '', + job_namespace int NOT NULL, + job_title varchar(255) binary NOT NULL, + job_params blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128)); +CREATE TABLE /*_*/querycache_info ( + qci_type varbinary(32) NOT NULL default '', + qci_timestamp binary(14) NOT NULL default '19700101000000' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type); +CREATE TABLE /*_*/redirect ( + rd_from int unsigned NOT NULL default 0 PRIMARY KEY, + rd_namespace int NOT NULL default 0, + rd_title varchar(255) binary NOT NULL default '', + rd_interwiki varchar(32) default NULL, + rd_fragment varchar(255) binary default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); +CREATE TABLE /*_*/querycachetwo ( + qcc_type varbinary(32) NOT NULL, + qcc_value int unsigned NOT NULL default 0, + qcc_namespace int NOT NULL default 0, + qcc_title varchar(255) binary NOT NULL default '', + qcc_namespacetwo int NOT NULL default 0, + qcc_titletwo varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); +CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); +CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); +CREATE TABLE /*_*/page_restrictions ( + pr_page int NOT NULL, + pr_type varbinary(60) NOT NULL, + pr_level varbinary(60) NOT NULL, + pr_cascade tinyint NOT NULL, + pr_user int NULL, + pr_expiry varbinary(14) NULL, + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); +CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level); +CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level); +CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); +CREATE TABLE /*_*/protected_titles ( + pt_namespace int NOT NULL, + pt_title varchar(255) binary NOT NULL, + pt_user int unsigned NOT NULL, + pt_reason tinyblob, + pt_timestamp binary(14) NOT NULL, + pt_expiry varbinary(14) NOT NULL default '', + pt_create_perm varbinary(60) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title); +CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp); +CREATE TABLE /*_*/page_props ( + pp_page int NOT NULL, + pp_propname varbinary(60) NOT NULL, + pp_value blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname); +CREATE TABLE /*_*/updatelog ( + ul_key varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/change_tag ( + ct_rc_id int NULL, + ct_log_id int NULL, + ct_rev_id int NULL, + ct_tag varchar(255) NOT NULL, + ct_params blob NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); +CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); +CREATE TABLE /*_*/tag_summary ( + ts_rc_id int NULL, + ts_log_id int NULL, + ts_rev_id int NULL, + ts_tags blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); +CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); +CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); +CREATE TABLE /*_*/valid_tag ( + vt_tag varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/l10n_cache ( + lc_lang varbinary(32) NOT NULL, + lc_key varchar(255) NOT NULL, + lc_value mediumblob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key); diff --git a/tests/phpunit/data/db/sqlite/tables-1.17.sql b/tests/phpunit/data/db/sqlite/tables-1.17.sql new file mode 100644 index 00000000..e02e3e14 --- /dev/null +++ b/tests/phpunit/data/db/sqlite/tables-1.17.sql @@ -0,0 +1,511 @@ +-- This is a copy of MediaWiki 1.17 schema shared by MySQL and SQLite. +-- It is used for updater testing. Comments are stripped to decrease +-- file size, as we don't need to maintain it. + +CREATE TABLE /*_*/user ( + user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_name varchar(255) binary NOT NULL default '', + user_real_name varchar(255) binary NOT NULL default '', + user_password tinyblob NOT NULL, + user_newpassword tinyblob NOT NULL, + user_newpass_time binary(14), + user_email tinytext NOT NULL, + user_options blob NOT NULL, + user_touched binary(14) NOT NULL default '', + user_token binary(32) NOT NULL default '', + user_email_authenticated binary(14), + user_email_token binary(32), + user_email_token_expires binary(14), + user_registration binary(14), + user_editcount int +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); +CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); +CREATE TABLE /*_*/user_groups ( + ug_user int unsigned NOT NULL default 0, + ug_group varbinary(16) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); +CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); +CREATE TABLE /*_*/user_newtalk ( + user_id int NOT NULL default 0, + user_ip varbinary(40) NOT NULL default '', + user_last_timestamp binary(14) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id); +CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip); +CREATE TABLE /*_*/user_properties ( + up_user int NOT NULL, + up_property varbinary(32) NOT NULL, + up_value blob +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property); +CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property); +CREATE TABLE /*_*/page ( + page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + page_namespace int NOT NULL, + page_title varchar(255) binary NOT NULL, + page_restrictions tinyblob NOT NULL, + page_counter bigint unsigned NOT NULL default 0, + page_is_redirect tinyint unsigned NOT NULL default 0, + page_is_new tinyint unsigned NOT NULL default 0, + page_random real unsigned NOT NULL, + page_touched binary(14) NOT NULL default '', + page_latest int unsigned NOT NULL, + page_len int unsigned NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); +CREATE INDEX /*i*/page_random ON /*_*/page (page_random); +CREATE INDEX /*i*/page_len ON /*_*/page (page_len); +CREATE TABLE /*_*/revision ( + rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + rev_page int unsigned NOT NULL, + rev_text_id int unsigned NOT NULL, + rev_comment tinyblob NOT NULL, + rev_user int unsigned NOT NULL default 0, + rev_user_text varchar(255) binary NOT NULL default '', + rev_timestamp binary(14) NOT NULL default '', + rev_minor_edit tinyint unsigned NOT NULL default 0, + rev_deleted tinyint unsigned NOT NULL default 0, + rev_len int unsigned, + rev_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; +CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id); +CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp); +CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp); +CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp); +CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp); +CREATE TABLE /*_*/text ( + old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + old_text mediumblob NOT NULL, + old_flags tinyblob NOT NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240; +CREATE TABLE /*_*/archive ( + ar_namespace int NOT NULL default 0, + ar_title varchar(255) binary NOT NULL default '', + ar_text mediumblob NOT NULL, + ar_comment tinyblob NOT NULL, + ar_user int unsigned NOT NULL default 0, + ar_user_text varchar(255) binary NOT NULL, + ar_timestamp binary(14) NOT NULL default '', + ar_minor_edit tinyint NOT NULL default 0, + ar_flags tinyblob NOT NULL, + ar_rev_id int unsigned, + ar_text_id int unsigned, + ar_deleted tinyint unsigned NOT NULL default 0, + ar_len int unsigned, + ar_page_id int unsigned, + ar_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp); +CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp); +CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id); +CREATE TABLE /*_*/pagelinks ( + pl_from int unsigned NOT NULL default 0, + pl_namespace int NOT NULL default 0, + pl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); +CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE TABLE /*_*/templatelinks ( + tl_from int unsigned NOT NULL default 0, + tl_namespace int NOT NULL default 0, + tl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); +CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE TABLE /*_*/imagelinks ( + il_from int unsigned NOT NULL default 0, + il_to varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); +CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE TABLE /*_*/categorylinks ( + cl_from int unsigned NOT NULL default 0, + cl_to varchar(255) binary NOT NULL default '', + cl_sortkey varbinary(230) NOT NULL default '', + cl_sortkey_prefix varchar(255) binary NOT NULL default '', + cl_timestamp timestamp NOT NULL, + cl_collation varbinary(32) NOT NULL default '', + cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to); +CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from); +CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp); +CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation); +CREATE TABLE /*_*/category ( + cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + cat_title varchar(255) binary NOT NULL, + cat_pages int signed NOT NULL default 0, + cat_subcats int signed NOT NULL default 0, + cat_files int signed NOT NULL default 0, + cat_hidden tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); +CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); +CREATE TABLE /*_*/externallinks ( + el_from int unsigned NOT NULL default 0, + el_to blob NOT NULL, + el_index blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); +CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); +CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); +CREATE TABLE /*_*/langlinks ( + ll_from int unsigned NOT NULL default 0, + ll_lang varbinary(20) NOT NULL default '', + ll_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); +CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); +CREATE TABLE /*_*/iwlinks ( + iwl_from int unsigned NOT NULL default 0, + iwl_prefix varbinary(20) NOT NULL default '', + iwl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); +CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from); +CREATE TABLE /*_*/site_stats ( + ss_row_id int unsigned NOT NULL, + ss_total_views bigint unsigned default 0, + ss_total_edits bigint unsigned default 0, + ss_good_articles bigint unsigned default 0, + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_active_users bigint default '-1', + ss_admins int default '-1', + ss_images int default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id); +CREATE TABLE /*_*/hitcounter ( + hc_id int unsigned NOT NULL +) ENGINE=HEAP MAX_ROWS=25000; +CREATE TABLE /*_*/ipblocks ( + ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + ipb_address tinyblob NOT NULL, + ipb_user int unsigned NOT NULL default 0, + ipb_by int unsigned NOT NULL default 0, + ipb_by_text varchar(255) binary NOT NULL default '', + ipb_reason tinyblob NOT NULL, + ipb_timestamp binary(14) NOT NULL default '', + ipb_auto bool NOT NULL default 0, + ipb_anon_only bool NOT NULL default 0, + ipb_create_account bool NOT NULL default 1, + ipb_enable_autoblock bool NOT NULL default '1', + ipb_expiry varbinary(14) NOT NULL default '', + ipb_range_start tinyblob NOT NULL, + ipb_range_end tinyblob NOT NULL, + ipb_deleted bool NOT NULL default 0, + ipb_block_email bool NOT NULL default 0, + ipb_allow_usertalk bool NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only); +CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user); +CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8)); +CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp); +CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry); +CREATE TABLE /*_*/image ( + img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, + img_size int unsigned NOT NULL default 0, + img_width int NOT NULL default 0, + img_height int NOT NULL default 0, + img_metadata mediumblob NOT NULL, + img_bits int NOT NULL default 0, + img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + img_minor_mime varbinary(100) NOT NULL default "unknown", + img_description tinyblob NOT NULL, + img_user int unsigned NOT NULL default 0, + img_user_text varchar(255) binary NOT NULL, + img_timestamp varbinary(14) NOT NULL default '', + img_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp); +CREATE INDEX /*i*/img_size ON /*_*/image (img_size); +CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp); +CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1); +CREATE TABLE /*_*/oldimage ( + oi_name varchar(255) binary NOT NULL default '', + oi_archive_name varchar(255) binary NOT NULL default '', + oi_size int unsigned NOT NULL default 0, + oi_width int NOT NULL default 0, + oi_height int NOT NULL default 0, + oi_bits int NOT NULL default 0, + oi_description tinyblob NOT NULL, + oi_user int unsigned NOT NULL default 0, + oi_user_text varchar(255) binary NOT NULL, + oi_timestamp binary(14) NOT NULL default '', + oi_metadata mediumblob NOT NULL, + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + oi_minor_mime varbinary(100) NOT NULL default "unknown", + oi_deleted tinyint unsigned NOT NULL default 0, + oi_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp); +CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp); +CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14)); +CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1); +CREATE TABLE /*_*/filearchive ( + fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + fa_name varchar(255) binary NOT NULL default '', + fa_archive_name varchar(255) binary default '', + fa_storage_group varbinary(16), + fa_storage_key varbinary(64) default '', + fa_deleted_user int, + fa_deleted_timestamp binary(14) default '', + fa_deleted_reason text, + fa_size int unsigned default 0, + fa_width int default 0, + fa_height int default 0, + fa_metadata mediumblob, + fa_bits int default 0, + fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", + fa_minor_mime varbinary(100) default "unknown", + fa_description tinyblob, + fa_user int unsigned default 0, + fa_user_text varchar(255) binary, + fa_timestamp binary(14) default '', + fa_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); +CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); +CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); +CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp); +CREATE TABLE /*_*/recentchanges ( + rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + rc_timestamp varbinary(14) NOT NULL default '', + rc_cur_time varbinary(14) NOT NULL default '', + rc_user int unsigned NOT NULL default 0, + rc_user_text varchar(255) binary NOT NULL, + rc_namespace int NOT NULL default 0, + rc_title varchar(255) binary NOT NULL default '', + rc_comment varchar(255) binary NOT NULL default '', + rc_minor tinyint unsigned NOT NULL default 0, + rc_bot tinyint unsigned NOT NULL default 0, + rc_new tinyint unsigned NOT NULL default 0, + rc_cur_id int unsigned NOT NULL default 0, + rc_this_oldid int unsigned NOT NULL default 0, + rc_last_oldid int unsigned NOT NULL default 0, + rc_type tinyint unsigned NOT NULL default 0, + rc_moved_to_ns tinyint unsigned NOT NULL default 0, + rc_moved_to_title varchar(255) binary NOT NULL default '', + rc_patrolled tinyint unsigned NOT NULL default 0, + rc_ip varbinary(40) NOT NULL default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint unsigned NOT NULL default 0, + rc_logid int unsigned NOT NULL default 0, + rc_log_type varbinary(255) NULL default NULL, + rc_log_action varbinary(255) NULL default NULL, + rc_params blob NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); +CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); +CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); +CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); +CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); +CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); +CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); +CREATE TABLE /*_*/watchlist ( + wl_user int unsigned NOT NULL, + wl_namespace int NOT NULL default 0, + wl_title varchar(255) binary NOT NULL default '', + wl_notificationtimestamp varbinary(14) +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); +CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); +CREATE TABLE /*_*/math ( + math_inputhash varbinary(16) NOT NULL, + math_outputhash varbinary(16) NOT NULL, + math_html_conservativeness tinyint NOT NULL, + math_html text, + math_mathml text +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash); +CREATE TABLE /*_*/searchindex ( + si_page int unsigned NOT NULL, + si_title varchar(255) NOT NULL default '', + si_text mediumtext NOT NULL +) ENGINE=MyISAM; +CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); +CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); +CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); +CREATE TABLE /*_*/interwiki ( + iw_prefix varchar(32) NOT NULL, + iw_url blob NOT NULL, + iw_api blob NOT NULL, + iw_wikiid varchar(64) NOT NULL, + iw_local bool NOT NULL, + iw_trans tinyint NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix); +CREATE TABLE /*_*/querycache ( + qc_type varbinary(32) NOT NULL, + qc_value int unsigned NOT NULL default 0, + qc_namespace int NOT NULL default 0, + qc_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); +CREATE TABLE /*_*/objectcache ( + keyname varbinary(255) NOT NULL default '' PRIMARY KEY, + value mediumblob, + exptime datetime +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); +CREATE TABLE /*_*/transcache ( + tc_url varbinary(255) NOT NULL, + tc_contents text, + tc_time binary(14) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url); +CREATE TABLE /*_*/logging ( + log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + log_type varbinary(32) NOT NULL default '', + log_action varbinary(32) NOT NULL default '', + log_timestamp binary(14) NOT NULL default '19700101000000', + log_user int unsigned NOT NULL default 0, + log_user_text varchar(255) binary NOT NULL default '', + log_namespace int NOT NULL default 0, + log_title varchar(255) binary NOT NULL default '', + log_page int unsigned NULL, + log_comment varchar(255) NOT NULL default '', + log_params blob NOT NULL, + log_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp); +CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp); +CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp); +CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp); +CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); +CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp); +CREATE TABLE /*_*/log_search ( + ls_field varbinary(32) NOT NULL, + ls_value varchar(255) NOT NULL, + ls_log_id int unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id); +CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); +CREATE TABLE /*_*/trackbacks ( + tb_id int PRIMARY KEY AUTO_INCREMENT, + tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE, + tb_title varchar(255) NOT NULL, + tb_url blob NOT NULL, + tb_ex text, + tb_name varchar(255) +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page); +CREATE TABLE /*_*/job ( + job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_cmd varbinary(60) NOT NULL default '', + job_namespace int NOT NULL, + job_title varchar(255) binary NOT NULL, + job_params blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128)); +CREATE TABLE /*_*/querycache_info ( + qci_type varbinary(32) NOT NULL default '', + qci_timestamp binary(14) NOT NULL default '19700101000000' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type); +CREATE TABLE /*_*/redirect ( + rd_from int unsigned NOT NULL default 0 PRIMARY KEY, + rd_namespace int NOT NULL default 0, + rd_title varchar(255) binary NOT NULL default '', + rd_interwiki varchar(32) default NULL, + rd_fragment varchar(255) binary default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); +CREATE TABLE /*_*/querycachetwo ( + qcc_type varbinary(32) NOT NULL, + qcc_value int unsigned NOT NULL default 0, + qcc_namespace int NOT NULL default 0, + qcc_title varchar(255) binary NOT NULL default '', + qcc_namespacetwo int NOT NULL default 0, + qcc_titletwo varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); +CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); +CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); +CREATE TABLE /*_*/page_restrictions ( + pr_page int NOT NULL, + pr_type varbinary(60) NOT NULL, + pr_level varbinary(60) NOT NULL, + pr_cascade tinyint NOT NULL, + pr_user int NULL, + pr_expiry varbinary(14) NULL, + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); +CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level); +CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level); +CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); +CREATE TABLE /*_*/protected_titles ( + pt_namespace int NOT NULL, + pt_title varchar(255) binary NOT NULL, + pt_user int unsigned NOT NULL, + pt_reason tinyblob, + pt_timestamp binary(14) NOT NULL, + pt_expiry varbinary(14) NOT NULL default '', + pt_create_perm varbinary(60) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title); +CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp); +CREATE TABLE /*_*/page_props ( + pp_page int NOT NULL, + pp_propname varbinary(60) NOT NULL, + pp_value blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname); +CREATE TABLE /*_*/updatelog ( + ul_key varchar(255) NOT NULL PRIMARY KEY, + ul_value blob +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/change_tag ( + ct_rc_id int NULL, + ct_log_id int NULL, + ct_rev_id int NULL, + ct_tag varchar(255) NOT NULL, + ct_params blob NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); +CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); +CREATE TABLE /*_*/tag_summary ( + ts_rc_id int NULL, + ts_log_id int NULL, + ts_rev_id int NULL, + ts_tags blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); +CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); +CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); +CREATE TABLE /*_*/valid_tag ( + vt_tag varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/l10n_cache ( + lc_lang varbinary(32) NOT NULL, + lc_key varchar(255) NOT NULL, + lc_value mediumblob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key); +CREATE TABLE /*_*/msg_resource ( + mr_resource varbinary(255) NOT NULL, + mr_lang varbinary(32) NOT NULL, + mr_blob mediumblob NOT NULL, + mr_timestamp binary(14) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang); +CREATE TABLE /*_*/msg_resource_links ( + mrl_resource varbinary(255) NOT NULL, + mrl_message varbinary(255) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource); +CREATE TABLE /*_*/module_deps ( + md_module varbinary(255) NOT NULL, + md_skin varbinary(32) NOT NULL, + md_deps mediumblob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin); diff --git a/tests/phpunit/data/db/sqlite/tables-1.18.sql b/tests/phpunit/data/db/sqlite/tables-1.18.sql new file mode 100644 index 00000000..8bfc28e2 --- /dev/null +++ b/tests/phpunit/data/db/sqlite/tables-1.18.sql @@ -0,0 +1,530 @@ +-- This is a copy of MediaWiki 1.18 schema shared by MySQL and SQLite. +-- It is used for updater testing. Comments are stripped to decrease +-- file size, as we don't need to maintain it. + +CREATE TABLE /*_*/user ( + user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + user_name varchar(255) binary NOT NULL default '', + user_real_name varchar(255) binary NOT NULL default '', + user_password tinyblob NOT NULL, + user_newpassword tinyblob NOT NULL, + user_newpass_time binary(14), + user_email tinytext NOT NULL, + user_options blob NOT NULL, + user_touched binary(14) NOT NULL default '', + user_token binary(32) NOT NULL default '', + user_email_authenticated binary(14), + user_email_token binary(32), + user_email_token_expires binary(14), + user_registration binary(14), + user_editcount int +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name); +CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token); +CREATE INDEX /*i*/user_email ON /*_*/user (user_email(50)); +CREATE TABLE /*_*/user_groups ( + ug_user int unsigned NOT NULL default 0, + ug_group varbinary(16) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group); +CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group); +CREATE TABLE /*_*/user_former_groups ( + ufg_user int unsigned NOT NULL default 0, + ufg_group varbinary(16) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ufg_user_group ON /*_*/user_former_groups (ufg_user,ufg_group); +CREATE TABLE /*_*/user_newtalk ( + user_id int NOT NULL default 0, + user_ip varbinary(40) NOT NULL default '', + user_last_timestamp varbinary(14) NULL default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id); +CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip); +CREATE TABLE /*_*/user_properties ( + up_user int NOT NULL, + up_property varbinary(255) NOT NULL, + up_value blob +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property); +CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property); +CREATE TABLE /*_*/page ( + page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + page_namespace int NOT NULL, + page_title varchar(255) binary NOT NULL, + page_restrictions tinyblob NOT NULL, + page_counter bigint unsigned NOT NULL default 0, + page_is_redirect tinyint unsigned NOT NULL default 0, + page_is_new tinyint unsigned NOT NULL default 0, + page_random real unsigned NOT NULL, + page_touched binary(14) NOT NULL default '', + page_latest int unsigned NOT NULL, + page_len int unsigned NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title); +CREATE INDEX /*i*/page_random ON /*_*/page (page_random); +CREATE INDEX /*i*/page_len ON /*_*/page (page_len); +CREATE TABLE /*_*/revision ( + rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + rev_page int unsigned NOT NULL, + rev_text_id int unsigned NOT NULL, + rev_comment tinyblob NOT NULL, + rev_user int unsigned NOT NULL default 0, + rev_user_text varchar(255) binary NOT NULL default '', + rev_timestamp binary(14) NOT NULL default '', + rev_minor_edit tinyint unsigned NOT NULL default 0, + rev_deleted tinyint unsigned NOT NULL default 0, + rev_len int unsigned, + rev_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; +CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id); +CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp); +CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp); +CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp); +CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp); +CREATE TABLE /*_*/text ( + old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + old_text mediumblob NOT NULL, + old_flags tinyblob NOT NULL +) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240; +CREATE TABLE /*_*/archive ( + ar_namespace int NOT NULL default 0, + ar_title varchar(255) binary NOT NULL default '', + ar_text mediumblob NOT NULL, + ar_comment tinyblob NOT NULL, + ar_user int unsigned NOT NULL default 0, + ar_user_text varchar(255) binary NOT NULL, + ar_timestamp binary(14) NOT NULL default '', + ar_minor_edit tinyint NOT NULL default 0, + ar_flags tinyblob NOT NULL, + ar_rev_id int unsigned, + ar_text_id int unsigned, + ar_deleted tinyint unsigned NOT NULL default 0, + ar_len int unsigned, + ar_page_id int unsigned, + ar_parent_id int unsigned default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp); +CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp); +CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id); +CREATE TABLE /*_*/pagelinks ( + pl_from int unsigned NOT NULL default 0, + pl_namespace int NOT NULL default 0, + pl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); +CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); +CREATE TABLE /*_*/templatelinks ( + tl_from int unsigned NOT NULL default 0, + tl_namespace int NOT NULL default 0, + tl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); +CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); +CREATE TABLE /*_*/imagelinks ( + il_from int unsigned NOT NULL default 0, + il_to varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to); +CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from); +CREATE TABLE /*_*/categorylinks ( + cl_from int unsigned NOT NULL default 0, + cl_to varchar(255) binary NOT NULL default '', + cl_sortkey varbinary(230) NOT NULL default '', + cl_sortkey_prefix varchar(255) binary NOT NULL default '', + cl_timestamp timestamp NOT NULL, + cl_collation varbinary(32) NOT NULL default '', + cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to); +CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from); +CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp); +CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation); +CREATE TABLE /*_*/category ( + cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + cat_title varchar(255) binary NOT NULL, + cat_pages int signed NOT NULL default 0, + cat_subcats int signed NOT NULL default 0, + cat_files int signed NOT NULL default 0, + cat_hidden tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title); +CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages); +CREATE TABLE /*_*/externallinks ( + el_from int unsigned NOT NULL default 0, + el_to blob NOT NULL, + el_index blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40)); +CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from); +CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60)); +CREATE TABLE /*_*/langlinks ( + ll_from int unsigned NOT NULL default 0, + ll_lang varbinary(20) NOT NULL default '', + ll_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); +CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); +CREATE TABLE /*_*/iwlinks ( + iwl_from int unsigned NOT NULL default 0, + iwl_prefix varbinary(20) NOT NULL default '', + iwl_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); +CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from); +CREATE TABLE /*_*/site_stats ( + ss_row_id int unsigned NOT NULL, + ss_total_views bigint unsigned default 0, + ss_total_edits bigint unsigned default 0, + ss_good_articles bigint unsigned default 0, + ss_total_pages bigint default '-1', + ss_users bigint default '-1', + ss_active_users bigint default '-1', + ss_admins int default '-1', + ss_images int default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id); +CREATE TABLE /*_*/hitcounter ( + hc_id int unsigned NOT NULL +) ENGINE=HEAP MAX_ROWS=25000; +CREATE TABLE /*_*/ipblocks ( + ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + ipb_address tinyblob NOT NULL, + ipb_user int unsigned NOT NULL default 0, + ipb_by int unsigned NOT NULL default 0, + ipb_by_text varchar(255) binary NOT NULL default '', + ipb_reason tinyblob NOT NULL, + ipb_timestamp binary(14) NOT NULL default '', + ipb_auto bool NOT NULL default 0, + ipb_anon_only bool NOT NULL default 0, + ipb_create_account bool NOT NULL default 1, + ipb_enable_autoblock bool NOT NULL default '1', + ipb_expiry varbinary(14) NOT NULL default '', + ipb_range_start tinyblob NOT NULL, + ipb_range_end tinyblob NOT NULL, + ipb_deleted bool NOT NULL default 0, + ipb_block_email bool NOT NULL default 0, + ipb_allow_usertalk bool NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only); +CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user); +CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8)); +CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp); +CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry); +CREATE TABLE /*_*/image ( + img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, + img_size int unsigned NOT NULL default 0, + img_width int NOT NULL default 0, + img_height int NOT NULL default 0, + img_metadata mediumblob NOT NULL, + img_bits int NOT NULL default 0, + img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + img_minor_mime varbinary(100) NOT NULL default "unknown", + img_description tinyblob NOT NULL, + img_user int unsigned NOT NULL default 0, + img_user_text varchar(255) binary NOT NULL, + img_timestamp varbinary(14) NOT NULL default '', + img_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp); +CREATE INDEX /*i*/img_size ON /*_*/image (img_size); +CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp); +CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1); +CREATE TABLE /*_*/oldimage ( + oi_name varchar(255) binary NOT NULL default '', + oi_archive_name varchar(255) binary NOT NULL default '', + oi_size int unsigned NOT NULL default 0, + oi_width int NOT NULL default 0, + oi_height int NOT NULL default 0, + oi_bits int NOT NULL default 0, + oi_description tinyblob NOT NULL, + oi_user int unsigned NOT NULL default 0, + oi_user_text varchar(255) binary NOT NULL, + oi_timestamp binary(14) NOT NULL default '', + oi_metadata mediumblob NOT NULL, + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", + oi_minor_mime varbinary(100) NOT NULL default "unknown", + oi_deleted tinyint unsigned NOT NULL default 0, + oi_sha1 varbinary(32) NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp); +CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp); +CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14)); +CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1); +CREATE TABLE /*_*/filearchive ( + fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + fa_name varchar(255) binary NOT NULL default '', + fa_archive_name varchar(255) binary default '', + fa_storage_group varbinary(16), + fa_storage_key varbinary(64) default '', + fa_deleted_user int, + fa_deleted_timestamp binary(14) default '', + fa_deleted_reason text, + fa_size int unsigned default 0, + fa_width int default 0, + fa_height int default 0, + fa_metadata mediumblob, + fa_bits int default 0, + fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", + fa_minor_mime varbinary(100) default "unknown", + fa_description tinyblob, + fa_user int unsigned default 0, + fa_user_text varchar(255) binary, + fa_timestamp binary(14) default '', + fa_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); +CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); +CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); +CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp); +CREATE TABLE /*_*/uploadstash ( + us_id int unsigned NOT NULL PRIMARY KEY auto_increment, + us_user int unsigned NOT NULL, + us_key varchar(255) NOT NULL, + us_orig_path varchar(255) NOT NULL, + us_path varchar(255) NOT NULL, + us_source_type varchar(50), + us_timestamp varbinary(14) not null, + us_status varchar(50) not null, + us_size int unsigned NOT NULL, + us_sha1 varchar(31) NOT NULL, + us_mime varchar(255), + us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, + us_image_width int unsigned, + us_image_height int unsigned, + us_image_bits smallint unsigned +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/us_user ON /*_*/uploadstash (us_user); +CREATE UNIQUE INDEX /*i*/us_key ON /*_*/uploadstash (us_key); +CREATE INDEX /*i*/us_timestamp ON /*_*/uploadstash (us_timestamp); +CREATE TABLE /*_*/recentchanges ( + rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT, + rc_timestamp varbinary(14) NOT NULL default '', + rc_cur_time varbinary(14) NOT NULL default '', + rc_user int unsigned NOT NULL default 0, + rc_user_text varchar(255) binary NOT NULL, + rc_namespace int NOT NULL default 0, + rc_title varchar(255) binary NOT NULL default '', + rc_comment varchar(255) binary NOT NULL default '', + rc_minor tinyint unsigned NOT NULL default 0, + rc_bot tinyint unsigned NOT NULL default 0, + rc_new tinyint unsigned NOT NULL default 0, + rc_cur_id int unsigned NOT NULL default 0, + rc_this_oldid int unsigned NOT NULL default 0, + rc_last_oldid int unsigned NOT NULL default 0, + rc_type tinyint unsigned NOT NULL default 0, + rc_moved_to_ns tinyint unsigned NOT NULL default 0, + rc_moved_to_title varchar(255) binary NOT NULL default '', + rc_patrolled tinyint unsigned NOT NULL default 0, + rc_ip varbinary(40) NOT NULL default '', + rc_old_len int, + rc_new_len int, + rc_deleted tinyint unsigned NOT NULL default 0, + rc_logid int unsigned NOT NULL default 0, + rc_log_type varbinary(255) NULL default NULL, + rc_log_action varbinary(255) NULL default NULL, + rc_params blob NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp); +CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title); +CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id); +CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp); +CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip); +CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text); +CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp); +CREATE TABLE /*_*/watchlist ( + wl_user int unsigned NOT NULL, + wl_namespace int NOT NULL default 0, + wl_title varchar(255) binary NOT NULL default '', + wl_notificationtimestamp varbinary(14) +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); +CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); +CREATE TABLE /*_*/searchindex ( + si_page int unsigned NOT NULL, + si_title varchar(255) NOT NULL default '', + si_text mediumtext NOT NULL +) ENGINE=MyISAM; +CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page); +CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title); +CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text); +CREATE TABLE /*_*/interwiki ( + iw_prefix varchar(32) NOT NULL, + iw_url blob NOT NULL, + iw_api blob NOT NULL, + iw_wikiid varchar(64) NOT NULL, + iw_local bool NOT NULL, + iw_trans tinyint NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix); +CREATE TABLE /*_*/querycache ( + qc_type varbinary(32) NOT NULL, + qc_value int unsigned NOT NULL default 0, + qc_namespace int NOT NULL default 0, + qc_title varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); +CREATE TABLE /*_*/objectcache ( + keyname varbinary(255) NOT NULL default '' PRIMARY KEY, + value mediumblob, + exptime datetime +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); +CREATE TABLE /*_*/transcache ( + tc_url varbinary(255) NOT NULL, + tc_contents text, + tc_time binary(14) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url); +CREATE TABLE /*_*/logging ( + log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + log_type varbinary(32) NOT NULL default '', + log_action varbinary(32) NOT NULL default '', + log_timestamp binary(14) NOT NULL default '19700101000000', + log_user int unsigned NOT NULL default 0, + log_user_text varchar(255) binary NOT NULL default '', + log_namespace int NOT NULL default 0, + log_title varchar(255) binary NOT NULL default '', + log_page int unsigned NULL, + log_comment varchar(255) NOT NULL default '', + log_params blob NOT NULL, + log_deleted tinyint unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp); +CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp); +CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp); +CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp); +CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp); +CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp); +CREATE TABLE /*_*/log_search ( + ls_field varbinary(32) NOT NULL, + ls_value varchar(255) NOT NULL, + ls_log_id int unsigned NOT NULL default 0 +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id); +CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id); +CREATE TABLE /*_*/trackbacks ( + tb_id int PRIMARY KEY AUTO_INCREMENT, + tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE, + tb_title varchar(255) NOT NULL, + tb_url blob NOT NULL, + tb_ex text, + tb_name varchar(255) +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page); +CREATE TABLE /*_*/job ( + job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + job_cmd varbinary(60) NOT NULL default '', + job_namespace int NOT NULL, + job_title varchar(255) binary NOT NULL, + job_params blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128)); +CREATE TABLE /*_*/querycache_info ( + qci_type varbinary(32) NOT NULL default '', + qci_timestamp binary(14) NOT NULL default '19700101000000' +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type); +CREATE TABLE /*_*/redirect ( + rd_from int unsigned NOT NULL default 0 PRIMARY KEY, + rd_namespace int NOT NULL default 0, + rd_title varchar(255) binary NOT NULL default '', + rd_interwiki varchar(32) default NULL, + rd_fragment varchar(255) binary default NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from); +CREATE TABLE /*_*/querycachetwo ( + qcc_type varbinary(32) NOT NULL, + qcc_value int unsigned NOT NULL default 0, + qcc_namespace int NOT NULL default 0, + qcc_title varchar(255) binary NOT NULL default '', + qcc_namespacetwo int NOT NULL default 0, + qcc_titletwo varchar(255) binary NOT NULL default '' +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value); +CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); +CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); +CREATE TABLE /*_*/page_restrictions ( + pr_page int NOT NULL, + pr_type varbinary(60) NOT NULL, + pr_level varbinary(60) NOT NULL, + pr_cascade tinyint NOT NULL, + pr_user int NULL, + pr_expiry varbinary(14) NULL, + pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type); +CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level); +CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level); +CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade); +CREATE TABLE /*_*/protected_titles ( + pt_namespace int NOT NULL, + pt_title varchar(255) binary NOT NULL, + pt_user int unsigned NOT NULL, + pt_reason tinyblob, + pt_timestamp binary(14) NOT NULL, + pt_expiry varbinary(14) NOT NULL default '', + pt_create_perm varbinary(60) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title); +CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp); +CREATE TABLE /*_*/page_props ( + pp_page int NOT NULL, + pp_propname varbinary(60) NOT NULL, + pp_value blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname); +CREATE TABLE /*_*/updatelog ( + ul_key varchar(255) NOT NULL PRIMARY KEY, + ul_value blob +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/change_tag ( + ct_rc_id int NULL, + ct_log_id int NULL, + ct_rev_id int NULL, + ct_tag varchar(255) NOT NULL, + ct_params blob NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); +CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); +CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); +CREATE TABLE /*_*/tag_summary ( + ts_rc_id int NULL, + ts_log_id int NULL, + ts_rev_id int NULL, + ts_tags blob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); +CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); +CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); +CREATE TABLE /*_*/valid_tag ( + vt_tag varchar(255) NOT NULL PRIMARY KEY +) /*$wgDBTableOptions*/; +CREATE TABLE /*_*/l10n_cache ( + lc_lang varbinary(32) NOT NULL, + lc_key varchar(255) NOT NULL, + lc_value mediumblob NOT NULL +) /*$wgDBTableOptions*/; +CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key); +CREATE TABLE /*_*/msg_resource ( + mr_resource varbinary(255) NOT NULL, + mr_lang varbinary(32) NOT NULL, + mr_blob mediumblob NOT NULL, + mr_timestamp binary(14) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang); +CREATE TABLE /*_*/msg_resource_links ( + mrl_resource varbinary(255) NOT NULL, + mrl_message varbinary(255) NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource); +CREATE TABLE /*_*/module_deps ( + md_module varbinary(255) NOT NULL, + md_skin varbinary(32) NOT NULL, + md_deps mediumblob NOT NULL +) /*$wgDBTableOptions*/; +CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin); + diff --git a/tests/phpunit/data/less/common/test.common.mixins.less b/tests/phpunit/data/less/common/test.common.mixins.less new file mode 100644 index 00000000..2fbe9b79 --- /dev/null +++ b/tests/phpunit/data/less/common/test.common.mixins.less @@ -0,0 +1,5 @@ +.test-mixin (@value) { + color: @value; + border: @foo solid @Foo; + line-height: test-sum(@bar, 10, 20); +} diff --git a/tests/phpunit/data/less/module/dependency.less b/tests/phpunit/data/less/module/dependency.less new file mode 100644 index 00000000..c7725a25 --- /dev/null +++ b/tests/phpunit/data/less/module/dependency.less @@ -0,0 +1,3 @@ +@import "test.common.mixins"; + +@unitTestColor: green; diff --git a/tests/phpunit/data/less/module/styles.css b/tests/phpunit/data/less/module/styles.css new file mode 100644 index 00000000..b78780a9 --- /dev/null +++ b/tests/phpunit/data/less/module/styles.css @@ -0,0 +1,6 @@ +/* @noflip */ +.unit-tests { + color: green; + border: 2px solid #eeeeee; + line-height: 35; +} diff --git a/tests/phpunit/data/less/module/styles.less b/tests/phpunit/data/less/module/styles.less new file mode 100644 index 00000000..ecac8392 --- /dev/null +++ b/tests/phpunit/data/less/module/styles.less @@ -0,0 +1,6 @@ +@import "dependency"; + +/* @noflip */ +.unit-tests { + .test-mixin(@unitTestColor); +} diff --git a/tests/phpunit/data/media/1bit-png.png b/tests/phpunit/data/media/1bit-png.png new file mode 100644 index 00000000..254e403a Binary files /dev/null and b/tests/phpunit/data/media/1bit-png.png differ diff --git a/tests/phpunit/data/media/80x60-2layers.xcf b/tests/phpunit/data/media/80x60-2layers.xcf new file mode 100644 index 00000000..c51e980c Binary files /dev/null and b/tests/phpunit/data/media/80x60-2layers.xcf differ diff --git a/tests/phpunit/data/media/80x60-Greyscale.xcf b/tests/phpunit/data/media/80x60-Greyscale.xcf new file mode 100644 index 00000000..84bf3e67 Binary files /dev/null and b/tests/phpunit/data/media/80x60-Greyscale.xcf differ diff --git a/tests/phpunit/data/media/80x60-RGB.xcf b/tests/phpunit/data/media/80x60-RGB.xcf new file mode 100644 index 00000000..1d58f16d Binary files /dev/null and b/tests/phpunit/data/media/80x60-RGB.xcf differ diff --git a/tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png b/tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png new file mode 100644 index 00000000..c2f45d90 Binary files /dev/null and b/tests/phpunit/data/media/Animated_PNG_example_bouncing_beach_ball.png differ diff --git a/tests/phpunit/data/media/Gtk-media-play-ltr.svg b/tests/phpunit/data/media/Gtk-media-play-ltr.svg new file mode 100644 index 00000000..fc22338a --- /dev/null +++ b/tests/phpunit/data/media/Gtk-media-play-ltr.svg @@ -0,0 +1,35 @@ + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/phpunit/data/media/Png-native-test.png b/tests/phpunit/data/media/Png-native-test.png new file mode 100644 index 00000000..a0b81ca9 Binary files /dev/null and b/tests/phpunit/data/media/Png-native-test.png differ diff --git a/tests/phpunit/data/media/QA_icon.svg b/tests/phpunit/data/media/QA_icon.svg new file mode 100644 index 00000000..6b5d86e4 --- /dev/null +++ b/tests/phpunit/data/media/QA_icon.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ? + + + + + + + + \ No newline at end of file diff --git a/tests/phpunit/data/media/README b/tests/phpunit/data/media/README new file mode 100644 index 00000000..fe3bc682 --- /dev/null +++ b/tests/phpunit/data/media/README @@ -0,0 +1,38 @@ +This directory contains media files for use with the +tests in includes/media directory. + +Image credits: + +QA_icon.svg: +http://es.wikipedia.org/wiki/Archivo:QA_icon.svg +GNU Lesser General Public License +~~helix84 (16.4.2007), Philverney (6.12.2005) David Vignoni + +Gtk-media-play-ltr.svg +http://commons.wikimedia.org/wiki/File:Gtk-media-play-ltr.svg +GNU Lesser General Public License +http://ftp.gnome.org/pub/GNOME/sources/gnome-themes-extras/0.9/gnome-themes-extras-0.9.0.tar.gz +David Vignoni + +US_states_by_total_state_tax_revenue.svg +http://commons.wikimedia.org/wiki/File:US_states_by_total_state_tax_revenue.svg +CC-BY 3.0 +TastyCakes on English Wikipedia + +greyscale-na-png.png, rgb-png.png, Xmp-exif-multilingual_test.jpg +greyscale-png.png, 1bit-png.png, Png-native-test.png, rgb-na-png.png, +test.tiff, test.jpg, jpeg-comment-multiple.jpg, jpeg-comment-utf.jpg, +jpeg-comment-iso8859-1.jpg, jpeg-comment-binary.jpg, jpeg-xmp-psir.jpg, +jpeg-xmp-alt.jpg, animated.gif, exif-user-comment.jpg, animated-xmp.gif, +iptc-timetest-invalid.jpg, jpeg-iptc-bad-hash.jpg, iptc-timetest.jpg, +xmp.png, nonanimated.gif, exif-gps.jpg, jpeg-xmp-psir.xmp, jpeg-iptc-good-hash.jpg, +jpeg-padding-even.jpg, jpeg-padding-odd.jpg +Are all by Bawolff. I don't think they contain enough originality to +claim copyright, but on the off chance they do, feel free to use them +however you feel fit, without restriction. + +Animated_PNG_example_bouncing_beach_ball.png +http://commons.wikimedia.org/wiki/File:Animated_PNG_example_bouncing_beach_ball.png (originally http://www.treebuilder.de/default.asp?file=89031.xml ) +Public Domain +Holger Will + diff --git a/tests/phpunit/data/media/Toll_Texas_1.svg b/tests/phpunit/data/media/Toll_Texas_1.svg new file mode 100644 index 00000000..73004e3e --- /dev/null +++ b/tests/phpunit/data/media/Toll_Texas_1.svg @@ -0,0 +1,150 @@ + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg b/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg new file mode 100644 index 00000000..9afea859 --- /dev/null +++ b/tests/phpunit/data/media/US_states_by_total_state_tax_revenue.svg @@ -0,0 +1,248 @@ + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/phpunit/data/media/Wikimedia-logo.svg b/tests/phpunit/data/media/Wikimedia-logo.svg new file mode 100644 index 00000000..1e17acbe --- /dev/null +++ b/tests/phpunit/data/media/Wikimedia-logo.svg @@ -0,0 +1,14 @@ + + + \ No newline at end of file diff --git a/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg b/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg new file mode 100644 index 00000000..f7b23025 Binary files /dev/null and b/tests/phpunit/data/media/Xmp-exif-multilingual_test.jpg differ diff --git a/tests/phpunit/data/media/animated-xmp.gif b/tests/phpunit/data/media/animated-xmp.gif new file mode 100644 index 00000000..fcba079d Binary files /dev/null and b/tests/phpunit/data/media/animated-xmp.gif differ diff --git a/tests/phpunit/data/media/animated.gif b/tests/phpunit/data/media/animated.gif new file mode 100644 index 00000000..a8f248b3 Binary files /dev/null and b/tests/phpunit/data/media/animated.gif differ diff --git a/tests/phpunit/data/media/broken_exif_date.jpg b/tests/phpunit/data/media/broken_exif_date.jpg new file mode 100644 index 00000000..82f62f57 Binary files /dev/null and b/tests/phpunit/data/media/broken_exif_date.jpg differ diff --git a/tests/phpunit/data/media/exif-gps.jpg b/tests/phpunit/data/media/exif-gps.jpg new file mode 100644 index 00000000..40137340 Binary files /dev/null and b/tests/phpunit/data/media/exif-gps.jpg differ diff --git a/tests/phpunit/data/media/exif-user-comment.jpg b/tests/phpunit/data/media/exif-user-comment.jpg new file mode 100644 index 00000000..9f23966a Binary files /dev/null and b/tests/phpunit/data/media/exif-user-comment.jpg differ diff --git a/tests/phpunit/data/media/greyscale-na-png.png b/tests/phpunit/data/media/greyscale-na-png.png new file mode 100644 index 00000000..4a4b7452 Binary files /dev/null and b/tests/phpunit/data/media/greyscale-na-png.png differ diff --git a/tests/phpunit/data/media/greyscale-png.png b/tests/phpunit/data/media/greyscale-png.png new file mode 100644 index 00000000..340a67b4 Binary files /dev/null and b/tests/phpunit/data/media/greyscale-png.png differ diff --git a/tests/phpunit/data/media/iptc-invalid-psir.jpg b/tests/phpunit/data/media/iptc-invalid-psir.jpg new file mode 100644 index 00000000..01b9acf3 Binary files /dev/null and b/tests/phpunit/data/media/iptc-invalid-psir.jpg differ diff --git a/tests/phpunit/data/media/iptc-timetest-invalid.jpg b/tests/phpunit/data/media/iptc-timetest-invalid.jpg new file mode 100644 index 00000000..b03e192a Binary files /dev/null and b/tests/phpunit/data/media/iptc-timetest-invalid.jpg differ diff --git a/tests/phpunit/data/media/iptc-timetest.jpg b/tests/phpunit/data/media/iptc-timetest.jpg new file mode 100644 index 00000000..db9932ba Binary files /dev/null and b/tests/phpunit/data/media/iptc-timetest.jpg differ diff --git a/tests/phpunit/data/media/jpeg-comment-binary.jpg b/tests/phpunit/data/media/jpeg-comment-binary.jpg new file mode 100644 index 00000000..b467fe43 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-comment-binary.jpg differ diff --git a/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg b/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg new file mode 100644 index 00000000..d9ffbac1 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-comment-iso8859-1.jpg differ diff --git a/tests/phpunit/data/media/jpeg-comment-multiple.jpg b/tests/phpunit/data/media/jpeg-comment-multiple.jpg new file mode 100644 index 00000000..363c7385 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-comment-multiple.jpg differ diff --git a/tests/phpunit/data/media/jpeg-comment-utf.jpg b/tests/phpunit/data/media/jpeg-comment-utf.jpg new file mode 100644 index 00000000..d6d35b4b Binary files /dev/null and b/tests/phpunit/data/media/jpeg-comment-utf.jpg differ diff --git a/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg new file mode 100644 index 00000000..6464c5b8 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-iptc-bad-hash.jpg differ diff --git a/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg b/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg new file mode 100644 index 00000000..ef970854 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-iptc-good-hash.jpg differ diff --git a/tests/phpunit/data/media/jpeg-padding-even.jpg b/tests/phpunit/data/media/jpeg-padding-even.jpg new file mode 100644 index 00000000..c83c66bd Binary files /dev/null and b/tests/phpunit/data/media/jpeg-padding-even.jpg differ diff --git a/tests/phpunit/data/media/jpeg-padding-odd.jpg b/tests/phpunit/data/media/jpeg-padding-odd.jpg new file mode 100644 index 00000000..25b93308 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-padding-odd.jpg differ diff --git a/tests/phpunit/data/media/jpeg-xmp-alt.jpg b/tests/phpunit/data/media/jpeg-xmp-alt.jpg new file mode 100644 index 00000000..0e2c3f63 Binary files /dev/null and b/tests/phpunit/data/media/jpeg-xmp-alt.jpg differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.jpg b/tests/phpunit/data/media/jpeg-xmp-psir.jpg new file mode 100644 index 00000000..4d19fcbe Binary files /dev/null and b/tests/phpunit/data/media/jpeg-xmp-psir.jpg differ diff --git a/tests/phpunit/data/media/jpeg-xmp-psir.xmp b/tests/phpunit/data/media/jpeg-xmp-psir.xmp new file mode 100644 index 00000000..fee6ee18 --- /dev/null +++ b/tests/phpunit/data/media/jpeg-xmp-psir.xmp @@ -0,0 +1,35 @@ + + + + + + jpeg-xmp-psir.jpg + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/phpunit/data/media/landscape-plain.jpg b/tests/phpunit/data/media/landscape-plain.jpg new file mode 100644 index 00000000..cf296555 Binary files /dev/null and b/tests/phpunit/data/media/landscape-plain.jpg differ diff --git a/tests/phpunit/data/media/nonanimated.gif b/tests/phpunit/data/media/nonanimated.gif new file mode 100644 index 00000000..9e52a7f0 Binary files /dev/null and b/tests/phpunit/data/media/nonanimated.gif differ diff --git a/tests/phpunit/data/media/portrait-rotated.jpg b/tests/phpunit/data/media/portrait-rotated.jpg new file mode 100644 index 00000000..445feaed Binary files /dev/null and b/tests/phpunit/data/media/portrait-rotated.jpg differ diff --git a/tests/phpunit/data/media/rgb-na-png.png b/tests/phpunit/data/media/rgb-na-png.png new file mode 100644 index 00000000..2f2a5ca0 Binary files /dev/null and b/tests/phpunit/data/media/rgb-na-png.png differ diff --git a/tests/phpunit/data/media/rgb-png.png b/tests/phpunit/data/media/rgb-png.png new file mode 100644 index 00000000..6f40cc92 Binary files /dev/null and b/tests/phpunit/data/media/rgb-png.png differ diff --git a/tests/phpunit/data/media/test.jpg b/tests/phpunit/data/media/test.jpg new file mode 100644 index 00000000..cb084253 Binary files /dev/null and b/tests/phpunit/data/media/test.jpg differ diff --git a/tests/phpunit/data/media/test.tiff b/tests/phpunit/data/media/test.tiff new file mode 100644 index 00000000..6a36f760 Binary files /dev/null and b/tests/phpunit/data/media/test.tiff differ diff --git a/tests/phpunit/data/media/xmp.png b/tests/phpunit/data/media/xmp.png new file mode 100644 index 00000000..6b9f7a87 Binary files /dev/null and b/tests/phpunit/data/media/xmp.png differ diff --git a/tests/phpunit/data/xmp/1.result.php b/tests/phpunit/data/xmp/1.result.php new file mode 100644 index 00000000..beead1bd --- /dev/null +++ b/tests/phpunit/data/xmp/1.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '9' + ) +); diff --git a/tests/phpunit/data/xmp/1.xmp b/tests/phpunit/data/xmp/1.xmp new file mode 100644 index 00000000..66e15427 --- /dev/null +++ b/tests/phpunit/data/xmp/1.xmp @@ -0,0 +1,11 @@ + + + + +True 0 1 False False + + diff --git a/tests/phpunit/data/xmp/2.result.php b/tests/phpunit/data/xmp/2.result.php new file mode 100644 index 00000000..beead1bd --- /dev/null +++ b/tests/phpunit/data/xmp/2.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '9' + ) +); diff --git a/tests/phpunit/data/xmp/2.xmp b/tests/phpunit/data/xmp/2.xmp new file mode 100644 index 00000000..0fa6a894 --- /dev/null +++ b/tests/phpunit/data/xmp/2.xmp @@ -0,0 +1,12 @@ + + + + + +True 1 False False + + diff --git a/tests/phpunit/data/xmp/3-invalid.result.php b/tests/phpunit/data/xmp/3-invalid.result.php new file mode 100644 index 00000000..5741b2c9 --- /dev/null +++ b/tests/phpunit/data/xmp/3-invalid.result.php @@ -0,0 +1,7 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ) +); diff --git a/tests/phpunit/data/xmp/3-invalid.xmp b/tests/phpunit/data/xmp/3-invalid.xmp new file mode 100644 index 00000000..2425e254 --- /dev/null +++ b/tests/phpunit/data/xmp/3-invalid.xmp @@ -0,0 +1,31 @@ + + + + + + + + +0/10 + +fred + + + + + + + + +1 +False + + False False + + diff --git a/tests/phpunit/data/xmp/3.result.php b/tests/phpunit/data/xmp/3.result.php new file mode 100644 index 00000000..beead1bd --- /dev/null +++ b/tests/phpunit/data/xmp/3.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '9' + ) +); diff --git a/tests/phpunit/data/xmp/3.xmp b/tests/phpunit/data/xmp/3.xmp new file mode 100644 index 00000000..2cf19883 --- /dev/null +++ b/tests/phpunit/data/xmp/3.xmp @@ -0,0 +1,29 @@ + + + + + + + +0/10 + +fred + + + + + + + +True + +1 +False + + False False + + diff --git a/tests/phpunit/data/xmp/4.result.php b/tests/phpunit/data/xmp/4.result.php new file mode 100644 index 00000000..5741b2c9 --- /dev/null +++ b/tests/phpunit/data/xmp/4.result.php @@ -0,0 +1,7 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ) +); diff --git a/tests/phpunit/data/xmp/4.xmp b/tests/phpunit/data/xmp/4.xmp new file mode 100644 index 00000000..29eb614b --- /dev/null +++ b/tests/phpunit/data/xmp/4.xmp @@ -0,0 +1,22 @@ + + + + + + + +0/10 + + +True 0 1 False False + + + + + + diff --git a/tests/phpunit/data/xmp/5.result.php b/tests/phpunit/data/xmp/5.result.php new file mode 100644 index 00000000..5741b2c9 --- /dev/null +++ b/tests/phpunit/data/xmp/5.result.php @@ -0,0 +1,7 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ) +); diff --git a/tests/phpunit/data/xmp/5.xmp b/tests/phpunit/data/xmp/5.xmp new file mode 100644 index 00000000..3cc61d68 --- /dev/null +++ b/tests/phpunit/data/xmp/5.xmp @@ -0,0 +1,16 @@ + + + + + + +True 0 1 False False + + + + + + diff --git a/tests/phpunit/data/xmp/6.result.php b/tests/phpunit/data/xmp/6.result.php new file mode 100644 index 00000000..beead1bd --- /dev/null +++ b/tests/phpunit/data/xmp/6.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '9' + ) +); diff --git a/tests/phpunit/data/xmp/6.xmp b/tests/phpunit/data/xmp/6.xmp new file mode 100644 index 00000000..f435ab23 --- /dev/null +++ b/tests/phpunit/data/xmp/6.xmp @@ -0,0 +1,18 @@ + + + + +0/10 + + + + + +True 0 1 False False + + diff --git a/tests/phpunit/data/xmp/7.result.php b/tests/phpunit/data/xmp/7.result.php new file mode 100644 index 00000000..115cdc92 --- /dev/null +++ b/tests/phpunit/data/xmp/7.result.php @@ -0,0 +1,52 @@ + + array( + 'CameraOwnerName' => 'Me!', + ), + 'xmp-general' => + array( + 'LicenseUrl' => 'http://creativecommons.com/cc-by-2.9', + 'ImageDescription' => + array( + 'x-default' => 'Test image for the cc: xmp: xmpRights: namespaces in xmp', + '_type' => 'lang', + ), + 'ObjectName' => + array( + 'x-default' => 'xmp core/xmp rights/cc ns test', + '_type' => 'lang', + ), + 'DateTimeDigitized' => '2005:04:03', + 'Software' => 'The one true editor: Vi (ok i used gimp)', + 'Identifier' => + array( + 0 => 'http://example.com/identifierurl', + 1 => 'urn:sha1:342524abcdef', + '_type' => 'ul', + ), + 'Label' => 'Test image', + 'DateTimeMetadata' => '2011:05:12', + 'DateTime' => '2007:03:04 06:34:10', + 'Nickname' => 'My little xmp test image', + 'Rating' => '5', + 'RightsCertificate' => 'http://example.com/rights-certificate/', + 'Copyrighted' => 'True', + 'CopyrightOwner' => + array( + 0 => 'Bawolff is copyright owner', + '_type' => 'ul', + ), + 'UsageTerms' => + array( + 'x-default' => 'do whatever you want', + 'en-gb' => 'Do whatever you want in british english', + '_type' => 'lang', + ), + 'WebStatement' => 'http://example.com/web_statement', + ), + 'xmp-deprecated' => + array( + 'Identifier' => 'http://example.com/identifierurl/wrong', + ), +); diff --git a/tests/phpunit/data/xmp/7.xmp b/tests/phpunit/data/xmp/7.xmp new file mode 100644 index 00000000..e18e13d9 --- /dev/null +++ b/tests/phpunit/data/xmp/7.xmp @@ -0,0 +1,67 @@ + + + + + + Me! + + + + http://creativecommons.com/cc-by-2.9 + + + + + + Test image for the cc: xmp: xmpRights: namespaces in xmp + + + http://example.com/identifierurl/wrong + + + xmp core/xmp rights/cc ns test + + + + + + 2005-04-03 + The one true editor: Vi (ok i used gimp) + + + http://example.com/identifierurl + + urn:sha1:342524abcdef + + + Test image + 2011-05-12 + 2007-03-04T12:34:10-06:00 + My little xmp test image + 7 + + + + http://example.com/rights-certificate/ + True + + + Bawolff is copyright owner + + + + + do whatever you want + Do whatever you want in british english + + + http://example.com/web_statement + + + + diff --git a/tests/phpunit/data/xmp/README b/tests/phpunit/data/xmp/README new file mode 100644 index 00000000..bd949176 --- /dev/null +++ b/tests/phpunit/data/xmp/README @@ -0,0 +1,3 @@ +This directory contains a bunch of XMP files +as well as a bunch of php files containing what the +parsed version of the XMP looks like. diff --git a/tests/phpunit/data/xmp/bag-for-seq.result.php b/tests/phpunit/data/xmp/bag-for-seq.result.php new file mode 100644 index 00000000..b5244f88 --- /dev/null +++ b/tests/phpunit/data/xmp/bag-for-seq.result.php @@ -0,0 +1,10 @@ + array( + 'Artist' => array( + '_type' => 'ul', + 0 => 'The author', + ) + ) +); diff --git a/tests/phpunit/data/xmp/bag-for-seq.xmp b/tests/phpunit/data/xmp/bag-for-seq.xmp new file mode 100644 index 00000000..c6ed5b7c --- /dev/null +++ b/tests/phpunit/data/xmp/bag-for-seq.xmp @@ -0,0 +1 @@ + The author diff --git a/tests/phpunit/data/xmp/flash.result.php b/tests/phpunit/data/xmp/flash.result.php new file mode 100644 index 00000000..018c0ac1 --- /dev/null +++ b/tests/phpunit/data/xmp/flash.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '127' + ) +); diff --git a/tests/phpunit/data/xmp/flash.xmp b/tests/phpunit/data/xmp/flash.xmp new file mode 100644 index 00000000..b1373cc2 --- /dev/null +++ b/tests/phpunit/data/xmp/flash.xmp @@ -0,0 +1,11 @@ + + + + +True 3 3 True True + + diff --git a/tests/phpunit/data/xmp/gps.result.php b/tests/phpunit/data/xmp/gps.result.php new file mode 100644 index 00000000..8ea9c68c --- /dev/null +++ b/tests/phpunit/data/xmp/gps.result.php @@ -0,0 +1,11 @@ + + array( + 'GPSAltitude' => -3.14159265301, + 'GPSDOP' => '5/1', + 'GPSLatitude' => 88.51805555, + 'GPSLongitude' => -21.12356945, + 'GPSVersionID' => '2.2.0.0' + ) +); diff --git a/tests/phpunit/data/xmp/gps.xmp b/tests/phpunit/data/xmp/gps.xmp new file mode 100644 index 00000000..e52d2c8a --- /dev/null +++ b/tests/phpunit/data/xmp/gps.xmp @@ -0,0 +1,17 @@ + + + + + + 103993/33102 + 1 + 5/1 + 88,31.083333N + 21,7.414167W + 2.2.0.0 + + + + + diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.result.php b/tests/phpunit/data/xmp/invalid-child-not-struct.result.php new file mode 100644 index 00000000..5741b2c9 --- /dev/null +++ b/tests/phpunit/data/xmp/invalid-child-not-struct.result.php @@ -0,0 +1,7 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ) +); diff --git a/tests/phpunit/data/xmp/invalid-child-not-struct.xmp b/tests/phpunit/data/xmp/invalid-child-not-struct.xmp new file mode 100644 index 00000000..6aa0c10b --- /dev/null +++ b/tests/phpunit/data/xmp/invalid-child-not-struct.xmp @@ -0,0 +1,12 @@ + + + +True 0 1 False False + + + + diff --git a/tests/phpunit/data/xmp/no-namespace.result.php b/tests/phpunit/data/xmp/no-namespace.result.php new file mode 100644 index 00000000..3ff69201 --- /dev/null +++ b/tests/phpunit/data/xmp/no-namespace.result.php @@ -0,0 +1,7 @@ + + array( + 'FNumber' => '28/10', + ) +); diff --git a/tests/phpunit/data/xmp/no-namespace.xmp b/tests/phpunit/data/xmp/no-namespace.xmp new file mode 100644 index 00000000..7d6cdb2f --- /dev/null +++ b/tests/phpunit/data/xmp/no-namespace.xmp @@ -0,0 +1,11 @@ + + + + + + diff --git a/tests/phpunit/data/xmp/no-recognized-props.result.php b/tests/phpunit/data/xmp/no-recognized-props.result.php new file mode 100644 index 00000000..b3ca9f5a --- /dev/null +++ b/tests/phpunit/data/xmp/no-recognized-props.result.php @@ -0,0 +1,2 @@ + + + + + diff --git a/tests/phpunit/data/xmp/utf16BE.result.php b/tests/phpunit/data/xmp/utf16BE.result.php new file mode 100644 index 00000000..ac7ea506 --- /dev/null +++ b/tests/phpunit/data/xmp/utf16BE.result.php @@ -0,0 +1,12 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ), + 'xmp-general' => + array( + 'Label' => '􊯍' + ), +); diff --git a/tests/phpunit/data/xmp/utf16BE.xmp b/tests/phpunit/data/xmp/utf16BE.xmp new file mode 100644 index 00000000..0cf60d60 Binary files /dev/null and b/tests/phpunit/data/xmp/utf16BE.xmp differ diff --git a/tests/phpunit/data/xmp/utf16LE.result.php b/tests/phpunit/data/xmp/utf16LE.result.php new file mode 100644 index 00000000..ac7ea506 --- /dev/null +++ b/tests/phpunit/data/xmp/utf16LE.result.php @@ -0,0 +1,12 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ), + 'xmp-general' => + array( + 'Label' => '􊯍' + ), +); diff --git a/tests/phpunit/data/xmp/utf16LE.xmp b/tests/phpunit/data/xmp/utf16LE.xmp new file mode 100644 index 00000000..66d71f4c Binary files /dev/null and b/tests/phpunit/data/xmp/utf16LE.xmp differ diff --git a/tests/phpunit/data/xmp/utf32BE.result.php b/tests/phpunit/data/xmp/utf32BE.result.php new file mode 100644 index 00000000..ac7ea506 --- /dev/null +++ b/tests/phpunit/data/xmp/utf32BE.result.php @@ -0,0 +1,12 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ), + 'xmp-general' => + array( + 'Label' => '􊯍' + ), +); diff --git a/tests/phpunit/data/xmp/utf32BE.xmp b/tests/phpunit/data/xmp/utf32BE.xmp new file mode 100644 index 00000000..06afdf92 Binary files /dev/null and b/tests/phpunit/data/xmp/utf32BE.xmp differ diff --git a/tests/phpunit/data/xmp/utf32LE.result.php b/tests/phpunit/data/xmp/utf32LE.result.php new file mode 100644 index 00000000..ac7ea506 --- /dev/null +++ b/tests/phpunit/data/xmp/utf32LE.result.php @@ -0,0 +1,12 @@ + + array( + 'DigitalZoomRatio' => '0/10', + ), + 'xmp-general' => + array( + 'Label' => '􊯍' + ), +); diff --git a/tests/phpunit/data/xmp/utf32LE.xmp b/tests/phpunit/data/xmp/utf32LE.xmp new file mode 100644 index 00000000..bf2097fe Binary files /dev/null and b/tests/phpunit/data/xmp/utf32LE.xmp differ diff --git a/tests/phpunit/data/xmp/xmpExt.result.php b/tests/phpunit/data/xmp/xmpExt.result.php new file mode 100644 index 00000000..beead1bd --- /dev/null +++ b/tests/phpunit/data/xmp/xmpExt.result.php @@ -0,0 +1,8 @@ + + array( + 'DigitalZoomRatio' => '0/10', + 'Flash' => '9' + ) +); diff --git a/tests/phpunit/data/xmp/xmpExt.xmp b/tests/phpunit/data/xmp/xmpExt.xmp new file mode 100644 index 00000000..da0383f8 --- /dev/null +++ b/tests/phpunit/data/xmp/xmpExt.xmp @@ -0,0 +1,13 @@ + + + + +True 0 1 False False + + diff --git a/tests/phpunit/data/xmp/xmpExt2.xmp b/tests/phpunit/data/xmp/xmpExt2.xmp new file mode 100644 index 00000000..060abb2c --- /dev/null +++ b/tests/phpunit/data/xmp/xmpExt2.xmp @@ -0,0 +1,8 @@ + + + + + diff --git a/tests/phpunit/data/zip/cd-gap.zip b/tests/phpunit/data/zip/cd-gap.zip new file mode 100644 index 00000000..b5ae6ccd Binary files /dev/null and b/tests/phpunit/data/zip/cd-gap.zip differ diff --git a/tests/phpunit/data/zip/cd-truncated.zip b/tests/phpunit/data/zip/cd-truncated.zip new file mode 100644 index 00000000..4d40d7d4 Binary files /dev/null and b/tests/phpunit/data/zip/cd-truncated.zip differ diff --git a/tests/phpunit/data/zip/class-trailing-null.zip b/tests/phpunit/data/zip/class-trailing-null.zip new file mode 100644 index 00000000..31dcf3d8 Binary files /dev/null and b/tests/phpunit/data/zip/class-trailing-null.zip differ diff --git a/tests/phpunit/data/zip/class-trailing-slash.zip b/tests/phpunit/data/zip/class-trailing-slash.zip new file mode 100644 index 00000000..9eb1f037 Binary files /dev/null and b/tests/phpunit/data/zip/class-trailing-slash.zip differ diff --git a/tests/phpunit/data/zip/class.zip b/tests/phpunit/data/zip/class.zip new file mode 100644 index 00000000..98a625b7 Binary files /dev/null and b/tests/phpunit/data/zip/class.zip differ diff --git a/tests/phpunit/data/zip/empty.zip b/tests/phpunit/data/zip/empty.zip new file mode 100644 index 00000000..15cb0ecb Binary files /dev/null and b/tests/phpunit/data/zip/empty.zip differ diff --git a/tests/phpunit/data/zip/looks-like-zip64.zip b/tests/phpunit/data/zip/looks-like-zip64.zip new file mode 100644 index 00000000..7428cddd Binary files /dev/null and b/tests/phpunit/data/zip/looks-like-zip64.zip differ diff --git a/tests/phpunit/data/zip/nosig.zip b/tests/phpunit/data/zip/nosig.zip new file mode 100644 index 00000000..a22c73a4 Binary files /dev/null and b/tests/phpunit/data/zip/nosig.zip differ diff --git a/tests/phpunit/data/zip/split.zip b/tests/phpunit/data/zip/split.zip new file mode 100644 index 00000000..6984ae6d Binary files /dev/null and b/tests/phpunit/data/zip/split.zip differ diff --git a/tests/phpunit/data/zip/trail.zip b/tests/phpunit/data/zip/trail.zip new file mode 100644 index 00000000..50bcea12 Binary files /dev/null and b/tests/phpunit/data/zip/trail.zip differ diff --git a/tests/phpunit/data/zip/wrong-cd-start-disk.zip b/tests/phpunit/data/zip/wrong-cd-start-disk.zip new file mode 100644 index 00000000..59b45938 Binary files /dev/null and b/tests/phpunit/data/zip/wrong-cd-start-disk.zip differ diff --git a/tests/phpunit/data/zip/wrong-central-entry-sig.zip b/tests/phpunit/data/zip/wrong-central-entry-sig.zip new file mode 100644 index 00000000..05329b43 Binary files /dev/null and b/tests/phpunit/data/zip/wrong-central-entry-sig.zip differ -- cgit v1.2.2