Page MenuHomePhabricator

LiquidThreads not compatible with PostgreSQL
Closed, ResolvedPublic

Description

Author: yackushevas

Description:
Hello
We have mediawiki 1.18.2 and LiquidThreads 2.0. When you run update.php get the error:

Creating thread table ... PHP Warning: pg_query (): Query failed: ERROR: syntax error at or near "("
LINE 2: thread_id int (8) unsigned NOT NULL PRIMARY KEY auto_increme ...

^ In / var / www / test / includes / db / DatabasePostgres.php on line 253

A database query syntax error has occurred.
The last attempted database query was:
"CREATE TABLE" thread "(
thread_id int (8) unsigned NOT NULL PRIMARY KEY auto_increment,
thread_root int (8) unsigned UNIQUE NOT NULL,
thread_ancestor int (8) unsigned NOT NULL,
thread_parent int (8) unsigned NULL,
thread_summary_page int (8) unsigned NULL,
thread_subject varchar (255) NULL,
thread_author_id int unsigned NULL,
thread_author_name varchar (255) NULL,
thread_modified char (14) binary NOT NULL default'',
thread_created char (14) binary NOT NULL default'',
thread_editedness int (1) NOT NULL default 0,
thread_article_namespace int NOT NULL,
thread_article_title varchar (255) binary NOT NULL,
thread_article_id int (8) unsigned NOT NULL,
thread_type int (4) unsigned NOT NULL default 0,
thread_sortkey varchar (255) NOT NULL default'',
thread_replies int (8) DEFAULT -1,
thread_signature TINYBLOB NULL,
UNIQUE (thread_root)
) / * $ WgDBTableOptions * /
"
from within function "DatabaseBase :: sourceFile (/ var / www / test / extensions / LiquidThreads / lqt.sql)".
Database returned error "1: ERROR: syntax error at or near" ("
LINE 2: thread_id int (8) unsigned NOT NULL PRIMARY KEY auto_increme ...

^ "

Change the name lqt.pg.sql to lqt.sql, run update.php:

Creating thread table ... ok
... Thread_history table already exists.
Creating thread_pending_relationship table ... PHP Warning: pg_query (): Query failed: ERROR: syntax error at or near "unsigned"
LINE 2: tpr_thread int unsigned NOT NULL,

^ In / var / www / test / includes / db / DatabasePostgres.php on line 253

A database query syntax error has occurred.
The last attempted database query was:
"CREATE TABLE" thread_pending_relationship "(
tpr_thread int unsigned NOT NULL,
tpr_relationship varbinary (64) NOT NULL,
tpr_title varbinary (255) NOT NULL,
tpr_type varbinary (32) NOT NULL,
PRIMARY KEY (tpr_thread, tpr_relationship)
) / * $ WgDBTableOptions * /
"
from within function "DatabaseBase :: sourceFile (/ var / www / test / extensions / LiquidThreads / schema-changes / thread_pending_relationship.sql)".
Database returned error "1: ERROR: syntax error at or near" unsigned "
LINE 2: tpr_thread int unsigned NOT NULL,

^ "

Version: unspecified
Severity: critical
OS: Linux
Platform: PC

Details

Reference
bz36204

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
InvalidNone
ResolvedNone

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:21 AM
bzimport set Reference to bz36204.
bzimport added a subscriber: Unknown Object (MLST).

Changing summary, adding pg help -- Thanks, saper!

First installment to fix it is in gerrit change 6875

This is still far from working. After installation, when I try to post first thread on the empty user talk page, I get SQL error:

SELECT * FROM "thread" WHERE thread_id = ''

22P02: ERROR: invalid input syntax for integer: "" LINE 1: ...ds::where Saper */ * FROM "thread" WHERE thread_id = '' ^ .

Backtrace:
#0 /usr/home/saper/public_html/pg/w/includes/db/DatabasePostgres.php(394): DatabaseBase->reportQueryError('ERROR: invalid...', '22P02', 'SELECT * FROM...', 'Threads::where', false)
#1 /usr/home/saper/public_html/pg/w/includes/db/Database.php(920): DatabasePostgres->reportQueryError('ERROR: invalid...', '22P02', 'SELECT * FROM...', 'Threads::where', false)
#2 /usr/home/saper/public_html/pg/w/includes/db/Database.php(1393): DatabaseBase->query('SELECT * FROM...', 'Threads::where')
#3 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/Threads.php(98): DatabaseBase->select('thread', '*', Array, 'Threads::where', Array)
#4 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/Threads.php(167): Threads::where(Array, Array, true)
#5 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/View.php(1660): Threads::withId('')
#6 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/View.php(1819): LqtView->getMustShowThreads(Array)
#7 /usr/home/saper/gerrit/extensions/LiquidThreads/pages/TalkpageView.php(358): LqtView->showThread(Object(Thread))
#8 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/Dispatch.php(63): TalkpageView->show()
#9 /usr/home/saper/gerrit/extensions/LiquidThreads/classes/Dispatch.php(216): LqtDispatch::talkpageMain(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
#10 [internal function]: LqtDispatch::tryPage(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest), Object(MediaWiki))
#11 /usr/home/saper/public_html/pg/w/includes/Hooks.php(216): call_user_func_array('LqtDispatch::tr...', Array)
#12 /usr/home/saper/public_html/pg/w/includes/GlobalFunctions.php(3932): Hooks::run('MediaWikiPerfor...', Array)
#13 /usr/home/saper/public_html/pg/w/includes/Wiki.php(473): wfRunHooks('MediaWikiPerfor...', Array)
#14 /usr/home/saper/public_html/pg/w/includes/Wiki.php(277): MediaWiki->performAction(Object(Article))
#15 /usr/home/saper/public_html/pg/w/includes/Wiki.php(592): MediaWiki->performRequest()
#16 /usr/home/saper/public_html/pg/w/includes/Wiki.php(502): MediaWiki->main()
#17 /usr/home/saper/public_html/pg/w/index.php(58): MediaWiki->run()
#18 {main}

yackushevas wrote:

Using this version: https://gerrit.wikimedia.org/r/#/c/6875/

Now when you install another error occurs:

Adding thread_signature field to table thread...PHP Warning: pg_query(): Query failed: ERROR: type "tinyblob" does not exist
LINE 1: ... ) */ TABLE "thread" ADD COLUMN thread_signature TINYBLOB N...

^ in /var/www/test/includes/db/DatabasePostgres.php on line 253

A database query syntax error has occurred.
The last attempted database query was:
"ALTER TABLE "thread" ADD COLUMN thread_signature TINYBLOB NULL
"
from within function "DatabaseBase::sourceFile( /var/www/test/extensions/LiquidThreads/schema-changes/thread_signature.sql )".
Database returned error "1: ERROR: type "tinyblob" does not exist
LINE 1: ... ) */ TABLE "thread" ADD COLUMN thread_signature TINYBLOB N...

^"

(In reply to Anton Yackushev from comment #3)

Database returned error "1: ERROR: type "tinyblob" does not exist
LINE 1: ... ) */ TABLE "thread" ADD COLUMN thread_signature TINYBLOB N...

Wondering if that obsoletes bug 28042?

Jdforrester-WMF lowered the priority of this task from Medium to Lowest.Aug 4 2016, 11:34 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

LiquidThreads has been replaced by StructuredDiscussions on all Wikimedia production wikis (except one, which will be done soon). It is no longer under active development or maintenance, so I'm re-classifying all open LQT tasks as "Lowest" priority.

Migrating from the old tracking task to a tag for PostgreSQL-related tasks.