From 0c1b77e123dbafb96168fe6affd6373b9aa081fe Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Sat, 5 Mar 2005 15:36:07 +0000 Subject: Bug 284598: INSTR function is not supported by postgres Patch By Tomas Kopal r=mkanat, a=justdave --- checksetup.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'checksetup.pl') diff --git a/checksetup.pl b/checksetup.pl index 50791d0f4..99000abc8 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -4175,8 +4175,8 @@ if (!$dbh->bz_get_field_def('longdescs', 'already_wrapped')) { # at display-time. print "Fixing old, mis-wrapped comments...\n"; $dbh->do(q{UPDATE longdescs SET already_wrapped = 0 - WHERE ( POSITION('\n' IN thetext ) > 80 - OR POSITION('\n' IN thetext ) = 0 ) + WHERE (} . $dbh->sql_position(q{'\n'}, 'thetext') . q{ > 80 + OR } . $dbh->sql_position(q{'\n'}, 'thetext') . q{ = 0) AND SUBSTRING(thetext FROM 1 FOR 80) LIKE '% %'}); } @@ -4547,8 +4547,8 @@ if (!defined $dbh->bz_get_index_def('longdescs', 'thetext')) { print "Removing paths from filenames in attachments table...\n"; $sth = $dbh->prepare("SELECT attach_id, filename FROM attachments " . - "WHERE INSTR(filename, '/') " . - "OR INSTR(filename, '\\\\')"); + "WHERE " . $dbh->sql_position(q{'/'}, 'filename') . + " OR " . $dbh->sql_position(q{'\\\\'}, 'filename')); $sth->execute; while (my ($attach_id, $filename) = $sth->fetchrow_array) { -- cgit v1.2.3-24-g4f1b