r23606 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23605‎ | r23606 | r23607 >
Date:14:56, 1 July 2007
Author:kim
Status:old
Tags:
Comment:
Adding the SQL save log for DefinedMeaning:UnitTest

(+continuing work on RecordHelper)
Modified paths:
  • /trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php (modified) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/debugdata (added) (history)
  • /trunk/extensions/Wikidata/OmegaWiki/debugdata/UnitTest.log.working (added) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/OmegaWiki/debugdata/UnitTest.log.working
@@ -0,0 +1,150 @@
 2+Start request
 3+GET /wikidata/index.php?title=DefinedMeaning:UnitTest%20(663665)&dataset=uw
 4+Host: thex:8080
 5+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20070123 BonEcho/2.0.0.1
 6+Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
 7+Accept-Language: en-us,en;q=0.5
 8+Accept-Encoding: gzip,deflate
 9+Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 10+Keep-Alive: 300
 11+Connection: keep-alive
 12+Referer: http://thex:8080/wikidata/index.php?title=Expression:UnitTest
 13+Cookie: omegawikiUserName=Admin; omegawikiUserID=1
 14+
 15+Main cache: FakeMemCachedClient
 16+Message cache: MediaWikiBagOStuff
 17+Parser cache: MediaWikiBagOStuff
 18+Unstubbing $wgMessageCache on call of $wgMessageCache->addMessages from initializeWikidata
 19+Unstubbing $wgLoadBalancer on call of $wgLoadBalancer->getConnection from wfGetDB
 20+Unstubbing $wgUser on call of $wgUser->getOption from DataSet::fetchName
 21+Cache miss for user 1
 22+Unstubbing $wgContLang on call of $wgContLang->getDefaultUserOptionOverrides from User::getDefaultOptions
 23+Language::loadLocalisation(): got localisation for en from source
 24+Imported data set: OmegaWiki community
 25+Imported data set: test set
 26+Unstubbing $wgLang on call of $wgLang->getCode from MessageCache::get
 27+MessageCache::load(): got from global cache
 28+Unstubbing $wgParser on call of $wgParser->firstCallInit from MessageCache::transform
 29+Fully initialised
 30+Unstubbing $wgOut on call of $wgOut->setSquidMaxage from MediaWiki::performAction
 31+definedMeaningId:663665, filterLanguageId:0, possiblySynonymousRelationTypeId:0, queryTransactionInformation:QueryTransactionInformation (...)
 32+IP: 77.248.97.238
 33+OutputPage::sendCacheControl: no caching **
 34+Request ended normally
 35+
 36+
 37+Start request
 38+GET /wikidata/index.php?title=DefinedMeaning:UnitTest%20(663665)&dataset=uw
 39+Host: thex:8080
 40+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.1) Gecko/20070123 BonEcho/2.0.0.1
 41+Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
 42+Accept-Language: en-us,en;q=0.5
 43+Accept-Encoding: gzip,deflate
 44+Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
 45+Keep-Alive: 300
 46+Connection: keep-alive
 47+Referer: http://thex:8080/wikidata/index.php?title=Expression:UnitTest
 48+Cookie: omegawikiUserName=Admin; omegawikiUserID=1
 49+Pragma: no-cache
 50+Cache-Control: no-cache
 51+
 52+Main cache: FakeMemCachedClient
 53+Message cache: MediaWikiBagOStuff
 54+Parser cache: MediaWikiBagOStuff
 55+Unstubbing $wgMessageCache on call of $wgMessageCache->addMessages from initializeWikidata
 56+Unstubbing $wgLoadBalancer on call of $wgLoadBalancer->getConnection from wfGetDB
 57+SQL: BEGIN
 58+SQL: SELECT /* Database::select */ set_prefix FROM `wikidata_sets`
 59+SQL: select * from wikidata_sets where set_prefix='uw'
 60+Unstubbing $wgUser on call of $wgUser->getOption from DataSet::fetchName
 61+Cache miss for user 1
 62+SQL: SELECT /* User::loadFromDatabase */ * FROM `user` WHERE user_id = '1' LIMIT 1
 63+SQL: SELECT /* User::loadFromDatabase */ ug_group FROM `user_groups` WHERE ug_user = '1'
 64+Unstubbing $wgContLang on call of $wgContLang->getDefaultUserOptionOverrides from User::getDefaultOptions
 65+Language::loadLocalisation(): got localisation for en from source
 66+SQL: select language_id,wikimedia_key from language
 67+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 68+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 69+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.remove_transaction_id is NULL LIMIT 1
 70+Imported data set: OmegaWiki community
 71+SQL: select * from wikidata_sets where set_prefix='tt'
 72+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 73+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 74+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.remove_transaction_id is NULL LIMIT 1
 75+Imported data set: test set
 76+Unstubbing $wgLang on call of $wgLang->getCode from MessageCache::get
 77+SQL: SELECT /* MediaWikiBagOStuff::_doquery */ value,exptime FROM `objectcache` WHERE keyname='omegawiki:messages-hash'
 78+SQL: SELECT /* MediaWikiBagOStuff::_doquery */ value,exptime FROM `objectcache` WHERE keyname='omegawiki:messages'
 79+MessageCache::load(): got from global cache
 80+Unstubbing $wgParser on call of $wgParser->firstCallInit from MessageCache::transform
 81+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 82+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 83+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.remove_transaction_id is NULL LIMIT 1
 84+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 85+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and language_id='85' and uw_expression_ns.remove_transaction_id is NULL
 86+SQL: select spelling from uw_syntrans,uw_expression_ns where uw_syntrans.defined_meaning_id='0' and uw_expression_ns.expression_id=uw_syntrans.expression_id and uw_expression_ns.remove_transaction_id is NULL LIMIT 1
 87+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 88+Fully initialised
 89+SQL: SELECT `namespace`.ns_id, ns_search_default, ns_subpages, ns_parent, ns_target, ns_system, ns_hidden, ns_count, ns_class, ns_name, ns_default, ns_canonical FROM `namespace` LEFT JOIN `namespace_names` ON (`namespace_names`.ns_id=`namespace`.ns_id) ORDER BY `namespace`.ns_id ASC
 90+SQL: SELECT /* Article::pageData */ page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len FROM `page` WHERE page_namespace = '24' AND page_title = 'UnitTest_(663665)' LIMIT 1
 91+SQL: SELECT /* Title::loadRestrictions */ * FROM `page_restrictions` WHERE pr_page = '651038'
 92+SQL: SELECT /* Title::loadRestrictionsFromRow */ page_restrictions FROM `page` WHERE page_id = '651038' LIMIT 1
 93+Unstubbing $wgOut on call of $wgOut->setSquidMaxage from MediaWiki::performAction
 94+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 95+SQL: SELECT collection_id FROM uw_collection_ns WHERE collection_type="MAPP" AND uw_collection_ns.remove_transaction_id IS NULL LIMIT 1
 96+SQL: SELECT internal_member_id AS concept_id FROM uw_collection_contents WHERE member_mid='663665' AND collection_id=663640;
 97+SQL: SELECT collection_id FROM uw_collection_ns WHERE collection_type="MAPP" AND uw_collection_ns.remove_transaction_id IS NULL LIMIT 1
 98+SQL: SELECT member_mid FROM uw_collection_contents WHERE collection_id = '663640' AND internal_member_id=NULL
 99+SQL: SELECT collection_id FROM tt_collection_ns WHERE collection_type="MAPP" AND tt_collection_ns.remove_transaction_id IS NULL LIMIT 1
 100+SQL: SELECT member_mid FROM tt_collection_contents WHERE collection_id = '663641' AND internal_member_id=NULL
 101+SQL: SELECT collection_id FROM uw_collection_ns WHERE collection_type="MAPP" AND uw_collection_ns.remove_transaction_id IS NULL LIMIT 1
 102+SQL: SELECT internal_member_id AS concept_id FROM uw_collection_contents WHERE member_mid='663665' AND collection_id=663640;
 103+SQL: SELECT collection_id FROM uw_collection_ns WHERE collection_type="MAPP" AND uw_collection_ns.remove_transaction_id IS NULL LIMIT 1
 104+SQL: SELECT member_mid FROM uw_collection_contents WHERE collection_id = '663640' AND internal_member_id=NULL
 105+SQL: SELECT collection_id FROM tt_collection_ns WHERE collection_type="MAPP" AND tt_collection_ns.remove_transaction_id IS NULL LIMIT 1
 106+SQL: SELECT member_mid FROM tt_collection_contents WHERE collection_id = '663641' AND internal_member_id=NULL
 107+definedMeaningId:663665, filterLanguageId:0, possiblySynonymousRelationTypeId:0, queryTransactionInformation:QueryTransactionInformation (...)
 108+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 109+SQL: SELECT meaning_text_tcid FROM uw_defined_meaning WHERE defined_meaning_id=663665 AND uw_defined_meaning.remove_transaction_id IS NULL
 110+SQL: SELECT language_id, text_id FROM uw_translated_content WHERE translated_content_id=663667 AND uw_translated_content.remove_transaction_id IS NULL
 111+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 112+SQL: SELECT text_id, text_text FROM uw_text WHERE text_id IN (204570, 204572, 204573)
 113+SQL: SELECT value_id, object_id, attribute_mid, text FROM uw_text_attribute_values WHERE object_id IN (663667) AND uw_text_attribute_values.remove_transaction_id IS NULL
 114+SQL: SELECT value_id, object_id, attribute_mid, value_tcid FROM uw_translated_content_attribute_values WHERE object_id IN (663667) AND uw_translated_content_attribute_values.remove_transaction_id IS NULL
 115+SQL: SELECT value_id, object_id, attribute_mid, url FROM uw_url_attribute_values WHERE object_id IN (663667) AND uw_url_attribute_values.remove_transaction_id IS NULL
 116+SQL: SELECT value_id, object_id, option_id FROM uw_option_attribute_values WHERE object_id IN (663667) AND uw_option_attribute_values.remove_transaction_id IS NULL
 117+SQL: SELECT object_id, level_mid, attribute_mid, attribute_type FROM uw_class_attributes WHERE class_mid=663665 AND uw_class_attributes.remove_transaction_id IS NULL
 118+SQL: SELECT meaning_text_tcid, source_id FROM uw_alt_meaningtexts WHERE meaning_mid=663665 AND uw_alt_meaningtexts.remove_transaction_id IS NULL
 119+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 120+SQL: SELECT syntrans_sid, expression_id, identical_meaning FROM uw_syntrans WHERE defined_meaning_id=663665 AND uw_syntrans.remove_transaction_id IS NULL
 121+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 122+SQL: SELECT expression_id, language_id, spelling FROM uw_expression_ns WHERE expression_id IN (663664) AND uw_expression_ns.remove_transaction_id IS NULL
 123+SQL: SELECT value_id, object_id, attribute_mid, text FROM uw_text_attribute_values WHERE object_id IN (663666) AND uw_text_attribute_values.remove_transaction_id IS NULL
 124+SQL: SELECT value_id, object_id, attribute_mid, value_tcid FROM uw_translated_content_attribute_values WHERE object_id IN (663666) AND uw_translated_content_attribute_values.remove_transaction_id IS NULL
 125+SQL: SELECT value_id, object_id, attribute_mid, url FROM uw_url_attribute_values WHERE object_id IN (663666) AND uw_url_attribute_values.remove_transaction_id IS NULL
 126+SQL: SELECT value_id, object_id, option_id FROM uw_option_attribute_values WHERE object_id IN (663666) AND uw_option_attribute_values.remove_transaction_id IS NULL
 127+SQL: SELECT relation_id, relationtype_mid, meaning2_mid FROM uw_meaning_relations WHERE meaning1_mid=663665 AND uw_meaning_relations.remove_transaction_id IS NULL ORDER BY add_transaction_id
 128+SQL: SELECT relation_id, relationtype_mid, meaning1_mid FROM uw_meaning_relations WHERE meaning2_mid=663665 AND uw_meaning_relations.remove_transaction_id IS NULL ORDER BY relationtype_mid
 129+SQL: SELECT class_membership_id, class_mid FROM uw_class_membership WHERE class_member_mid=663665 AND uw_class_membership.remove_transaction_id IS NULL
 130+SQL: SELECT collection_id, internal_member_id FROM uw_collection_contents WHERE member_mid=663665 AND uw_collection_contents.remove_transaction_id IS NULL
 131+SQL: SELECT value_id, object_id, attribute_mid, text FROM uw_text_attribute_values WHERE object_id IN (663665) AND uw_text_attribute_values.remove_transaction_id IS NULL
 132+SQL: SELECT value_id, object_id, attribute_mid, value_tcid FROM uw_translated_content_attribute_values WHERE object_id IN (663665) AND uw_translated_content_attribute_values.remove_transaction_id IS NULL
 133+SQL: SELECT value_id, object_id, attribute_mid, url FROM uw_url_attribute_values WHERE object_id IN (663665) AND uw_url_attribute_values.remove_transaction_id IS NULL
 134+SQL: SELECT value_id, object_id, option_id FROM uw_option_attribute_values WHERE object_id IN (663665) AND uw_option_attribute_values.remove_transaction_id IS NULL
 135+SQL: SELECT language.language_id AS row_id,language_names.language_name FROM language JOIN language_names ON language.language_id = language_names.language_id WHERE language_names.name_language_id = 85
 136+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 137+SQL: SELECT /* Job::pop */ * FROM `job` ORDER BY job_id LIMIT 1
 138+SQL: COMMIT
 139+IP: 77.248.97.238
 140+SQL: BEGIN
 141+SQL: SELECT /* LinkBatch::doQuery */ page_id, page_namespace, page_title FROM `page` WHERE (page_namespace=2 AND page_title IN ('77.248.97.238')) OR (page_namespace=3 AND page_title IN ('77.248.97.238')) OR (page_namespace=25 AND page_title IN ('UnitTest_(663665)'))
 142+SQL: SELECT /* User::checkNewtalk */ user_ip FROM `user_newtalk` WHERE user_ip = '77.248.97.238' LIMIT 1
 143+SQL: SELECT /* Revision::fetchRow */ page_namespace,page_title,page_latest,rev_id,rev_page,rev_text_id,rev_comment,rev_user_text,rev_user,rev_minor_edit,rev_timestamp,rev_deleted FROM `page`,`revision` WHERE (page_id=rev_page) AND rev_page = '651038' AND page_id = '651038' AND (rev_id=page_latest) LIMIT 1
 144+SQL: SELECT /* MediaWikiBagOStuff::_doquery */ value,exptime FROM `objectcache` WHERE keyname='omegawiki:sitenotice'
 145+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 146+SQL: SELECT 1 FROM `uw_transactions` LIMIT 1
 147+OutputPage::sendCacheControl: no caching **
 148+SQL: COMMIT
 149+Request ended normally
 150+
 151+
Index: trunk/extensions/Wikidata/OmegaWiki/RecordHelper.php
@@ -67,9 +67,20 @@
6868 $this->saved=$saved;
6969 }
7070
71 - //public abstract function getSQL();
72 - //public abstract function save();
 71+ # should probably be abstract. Making non-abstract
 72+ # to save me from tearing my hair out while worrying about
 73+ # initial implementation
 74+ #public abstract function getSaveSQL($dc="uw");
 75+ public function getSaveSQL($dc="uw") {
 76+ $dc=wdGetDataSetContext($dc);
 77+ }
7378
 79+ public function save() {
 80+ $sql=$this->getSaveSQL();
 81+ $dbr = &wfGetDB(DB_MASTER);
 82+ $dbr->query($sql);
 83+ }
 84+
7485 }
7586
7687 class DefinitionHelper extends Helper {
@@ -78,11 +89,7 @@
7990 Helper::__construct($record);
8091 }
8192
82 - public function save() {
83 - /*what to do here eh?*/
84 - }
8593
86 -
8794 }
8895
8996 class TranslatedTextHelper extends Helper {
@@ -90,12 +97,6 @@
9198 echo "TranslatedTextHelper\n";
9299 Helper::__construct($record);
93100 }
94 -
95 - public function save() {
96 - /*what to do here eh?*/
97 - }
98 -
99 -
100101 }
101102
102103 class ObjectAttributesHelper extends Helper {
@@ -103,12 +104,6 @@
104105 echo "ObjectAttributesHelper\n";
105106 Helper::__construct($record);
106107 }
107 -
108 - public function save() {
109 - /*what to do here eh?*/
110 - }
111 -
112 -
113108 }
114109
115110 class SynonymsTranslationsHelper extends Helper {
@@ -116,12 +111,6 @@
117112 echo "SynonymsTranslationsHelper\n";
118113 Helper::__construct($record);
119114 }
120 -
121 - public function save() {
122 - /*what to do here eh?*/
123 - }
124 -
125 -
126115 }
127116
128117 class ExpressionHelper extends Helper {
@@ -131,15 +120,9 @@
132121 echo $record;
133122 }
134123
135 - public function getSQL() {
136 -
 124+ public function getSaveSQL($dc="uw") {
 125+ $dc=wdGetDataSetContext($dc);
137126 }
138 -
139 - public function save() {
140 - /*what to do here eh?*/
141 - }
142 -
143 -
144127 }
145128
146129
@@ -148,12 +131,6 @@
149132 echo "RelationsHelper\n";
150133 Helper::__construct($record);
151134 }
152 -
153 - public function save() {
154 - /*what to do here eh?*/
155 - }
156 -
157 -
158135 }
159136
160137 class RelationTypeHelper extends Helper {
@@ -161,23 +138,13 @@
162139 echo "RelationTypeHelper\n";
163140 Helper::__construct($record);
164141 }
165 -
166 - public function save() {
167 - /*what to do here eh?*/
168 - }
169 -}
 142+}
170143
171144 class OtherDefinedMeaningHelper extends Helper {
172145 public function __construct($record) {
173146 echo "OtherDefinedMeaningHelper\n";
174147 Helper::__construct($record);
175148 }
176 -
177 - public function save() {
178 - /*what to do here eh?*/
179 - }
180 -
181 -
182149 }
183150
184151 class ReciprocalRelationsHelper extends Helper {
@@ -185,12 +152,6 @@
186153 echo "ReciprocalRelationsHelper\n";
187154 Helper::__construct($record);
188155 }
189 -
190 - public function save() {
191 - /*what to do here eh?*/
192 - }
193 -
194 -
195156 }
196157
197158 class CollectionMembershipHelper extends Helper {
@@ -198,12 +159,6 @@
199160 echo "CollectionMembershipHelper\n";
200161 Helper::__construct($record);
201162 }
202 -
203 - public function save() {
204 - /*what to do here eh?*/
205 - }
206 -
207 -
208163 }
209164
210165 class CollectionMeaningHelper extends Helper {
@@ -211,12 +166,6 @@
212167 echo "CollectionMeaningHelper\n";
213168 Helper::__construct($record);
214169 }
215 -
216 - public function save() {
217 - /*what to do here eh?*/
218 - }
219 -
220 -
221170 }
222171
223172 class GotoSourceHelper extends Helper {
@@ -224,12 +173,6 @@
225174 echo "GotoSourceHelper\n";
226175 Helper::__construct($record);
227176 }
228 -
229 - public function save() {
230 - /*what to do here eh?*/
231 - }
232 -
233 -
234177 }
235178
236179 class DefinedMeaningAttributesHelper extends Helper {
@@ -237,11 +180,5 @@
238181 echo "DefinedMeaningAttributesHelper\n";
239182 Helper::__construct($record);
240183 }
241 -
242 - public function save() {
243 - /*what to do here eh?*/
244 - }
245 -
246 -
247184 }
248185

Status & tagging log