Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
142ebe85
Commit
142ebe85
authored
Feb 14, 2011
by
Sam Morris
Committed by
Max Kanat-Alexander
Feb 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 616981: Make whine.pl work with PostgreSQL 8.4+ by fixing sql_string_until
r=mkanat, a=mkanat
parent
f843497f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Pg.pm
Bugzilla/DB/Pg.pm
+12
-0
No files found.
Bugzilla/DB/Pg.pm
View file @
142ebe85
...
...
@@ -192,6 +192,18 @@ sub sql_string_concat {
return
'(CAST('
.
join
(
' AS text) || CAST('
,
@params
)
.
' AS text))'
;
}
sub
sql_string_until
{
my
(
$self
,
$string
,
$substring
)
=
@_
;
# PostgreSQL does not permit a negative substring length; therefore we
# use CASE to only perform the SUBSTRING operation when $substring can
# be found withing $string.
return
"CASE WHEN "
.
$self
->
sql_position
(
$substring
,
$string
)
.
" != 0 THEN SUBSTRING($string FROM 1 FOR "
.
$self
->
sql_position
(
$substring
,
$string
)
.
" - 1)"
.
" ELSE $string END"
;
}
# Tell us whether or not a particular sequence exists in the DB.
sub
bz_sequence_exists
{
my
(
$self
,
$seq_name
)
=
@_
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment