MyBB Community Forums
[F] PGSQL: Error during upgrade - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.1 (https://community.mybb.com/forum-93.html)
+------ Thread: [F] PGSQL: Error during upgrade (/thread-36444.html)



[F] PGSQL: Error during upgrade - Michael S. - 2008-08-22

During the upgrade of a board using pgsql you get the following error:
Quote:Fatal error: [SQL] [0] ERROR: invalid input syntax for integer: "yes"
SELECT name,sid FROM mybb_settings WHERE isdefault='1' OR isdefault='yes' in /var/www/testforum.blubotter.org/htdocs/moepforum/inc/db_pgsql.php on line 552
The query can be found in the file upgrade.php in the lines 717 and 723.

Possible fix: Replace
		$query = $db->simple_select("settings", "name,sid", "isdefault='1' OR isdefault='yes'");
		while($setting = $db->fetch_array($query))
		{
			$settings[$setting['sid']] = $setting['name'];
		}

		$query = $db->simple_select("settinggroups", "name,title,gid", "isdefault='1' OR isdefault='yes'");
with:
        if($db->type == "mysql" || $db->type == "mysqli")
        {
            $wheresettings = "isdefault='1' OR isdefault='yes'";
        }
        else
        {
            $wheresettings = "isdefault='1'";
        }
		$query = $db->simple_select("settings", "name,sid", $wheresettings);
		while($setting = $db->fetch_array($query))
		{
			$settings[$setting['sid']] = $setting['name'];
		}

		$query = $db->simple_select("settinggroups", "name,title,gid", $wheresettings);



[F] PGSQL: Error during upgrade - Ryan Gordon - 2008-08-26

Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.