Installation of SMF 2.0 RC2 fails on PostgreSQL

Started by k14, November 26, 2009, 05:51:28 PM

Previous topic - Next topic

k14

SMF Version: 2.0 RC2
PostgreSQL Version: 8.1.18
No mods, no langs, no nothing.

Actually, there were 2 bugs.

First was wrong detection of psql server version.
File: install.php:64
Is: 'utf8_version_check' => '$request = pg_query(\'SELECT version()\'); list ($version) = pg_fetch_row($request); return $version;',
My fix: 'utf8_version_check' => '$request = pg_query(\'SELECT version()\'); list ($version) = pg_fetch_row($request); $version=explode(" ", $version); return $version[1];',

Why? SELECT version() gives 'PostgreSQL 8.1.18 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)', witch was later truncated to 'PostgreSQL 8.1.18 on i486' and compared with '7.4.10'...

Second bug.
File: Sources/Subs-Db-postgresql.php, function smf_db_insert, block method == 'replace'
My fix (additional code on line 636): $entry = array_combine(array_keys($columns), $entry);

Why? $entry has keys (0, 1, 2...) witch don't meet variable names in $updateData nor $where, so smf_db_replacement__callback can't replace them with data.

Sorry, if those bugs have already been described. I haven't spent much time on searching the forum.

Norv

To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github


H

Marked this as solved, as it is covered in the other topic that Norv has linked to :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Advertisement: