Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0fc32c0

Browse files
committed
Fix sample INSTR function to return 0 if third arg is 0.
Albe Laurenz, per a report by Greg Smith that our sample functiondoesn't quite match Oracle's behavior.
1 parent72dd629 commit0fc32c0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎doc/src/sgml/plpgsql.sgml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5115,7 +5115,7 @@ BEGIN
51155115
ELSE
51165116
RETURN pos + beg_index - 1;
51175117
END IF;
5118-
ELSE
5118+
ELSIF beg_index < 0 THEN
51195119
ss_length := char_length(string_to_search);
51205120
length := char_length(string);
51215121
beg := length + beg_index - ss_length + 2;
@@ -5131,6 +5131,8 @@ BEGIN
51315131
beg := beg - 1;
51325132
END LOOP;
51335133

5134+
RETURN 0;
5135+
ELSE
51345136
RETURN 0;
51355137
END IF;
51365138
END;
@@ -5170,7 +5172,7 @@ BEGIN
51705172
ELSE
51715173
RETURN beg;
51725174
END IF;
5173-
ELSE
5175+
ELSIF beg_index < 0 THEN
51745176
ss_length := char_length(string_to_search);
51755177
length := char_length(string);
51765178
beg := length + beg_index - ss_length + 2;
@@ -5190,6 +5192,8 @@ BEGIN
51905192
beg := beg - 1;
51915193
END LOOP;
51925194

5195+
RETURN 0;
5196+
ELSE
51935197
RETURN 0;
51945198
END IF;
51955199
END;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp