Changeset View
Changeset View
Standalone View
Standalone View
src/server/handler/fetchhelper.cpp
Show First 20 Lines • Show All 363 Lines • ▼ Show 20 Line(s) | 363 | case Scope::Gid: | |||
---|---|---|---|---|---|
364 | throw HandlerException("Item query returned empty result set"); | 364 | throw HandlerException("Item query returned empty result set"); | ||
365 | break; | 365 | break; | ||
366 | default: | 366 | default: | ||
367 | break; | 367 | break; | ||
368 | } | 368 | } | ||
369 | } | 369 | } | ||
370 | // build part query if needed | 370 | // build part query if needed | ||
371 | BEGIN_TIMER(parts) | 371 | BEGIN_TIMER(parts) | ||
372 | QSqlQuery partQuery; | 372 | QSqlQuery partQuery(DataStore::self()->database()); | ||
373 | if (!mFetchScope.requestedParts().isEmpty() || mFetchScope.fullPayload() || mFetchScope.allAttributes()) { | 373 | if (!mFetchScope.requestedParts().isEmpty() || mFetchScope.fullPayload() || mFetchScope.allAttributes()) { | ||
374 | partQuery = buildPartQuery(mFetchScope.requestedParts(), mFetchScope.fullPayload(), mFetchScope.allAttributes()); | 374 | partQuery = buildPartQuery(mFetchScope.requestedParts(), mFetchScope.fullPayload(), mFetchScope.allAttributes()); | ||
375 | } | 375 | } | ||
376 | END_TIMER(parts) | 376 | END_TIMER(parts) | ||
377 | 377 | | |||
378 | // build flag query if needed | 378 | // build flag query if needed | ||
379 | BEGIN_TIMER(flags) | 379 | BEGIN_TIMER(flags) | ||
380 | QSqlQuery flagQuery; | 380 | QSqlQuery flagQuery(DataStore::self()->database()); | ||
381 | if (mFetchScope.fetchFlags()) { | 381 | if (mFetchScope.fetchFlags()) { | ||
382 | flagQuery = buildFlagQuery(); | 382 | flagQuery = buildFlagQuery(); | ||
383 | } | 383 | } | ||
384 | END_TIMER(flags) | 384 | END_TIMER(flags) | ||
385 | 385 | | |||
386 | // build tag query if needed | 386 | // build tag query if needed | ||
387 | BEGIN_TIMER(tags) | 387 | BEGIN_TIMER(tags) | ||
388 | QSqlQuery tagQuery; | 388 | QSqlQuery tagQuery(DataStore::self()->database()); | ||
389 | if (mFetchScope.fetchTags()) { | 389 | if (mFetchScope.fetchTags()) { | ||
390 | tagQuery = buildTagQuery(); | 390 | tagQuery = buildTagQuery(); | ||
391 | } | 391 | } | ||
392 | END_TIMER(tags) | 392 | END_TIMER(tags) | ||
393 | 393 | | |||
394 | BEGIN_TIMER(vRefs) | 394 | BEGIN_TIMER(vRefs) | ||
395 | QSqlQuery vRefQuery; | 395 | QSqlQuery vRefQuery(DataStore::self()->database()); | ||
396 | if (mFetchScope.fetchVirtualReferences()) { | 396 | if (mFetchScope.fetchVirtualReferences()) { | ||
397 | vRefQuery = buildVRefQuery(); | 397 | vRefQuery = buildVRefQuery(); | ||
398 | } | 398 | } | ||
399 | END_TIMER(vRefs) | 399 | END_TIMER(vRefs) | ||
400 | 400 | | |||
401 | #if ENABLE_FETCH_PROFILING | 401 | #if ENABLE_FETCH_PROFILING | ||
402 | int itemsCount = 0; | 402 | int itemsCount = 0; | ||
403 | int flagsCount = 0; | 403 | int flagsCount = 0; | ||
▲ Show 20 Lines • Show All 321 Lines • Show Last 20 Lines |