Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9c57d11f
Commit
9c57d11f
authored
Feb 13, 2014
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add C comment about problems with CHAR() space trimming
parent
b8f00a46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
src/backend/utils/adt/varchar.c
src/backend/utils/adt/varchar.c
+12
-0
No files found.
src/backend/utils/adt/varchar.c
View file @
9c57d11f
...
...
@@ -846,6 +846,18 @@ bpcharcmp(PG_FUNCTION_ARGS)
len2
;
int
cmp
;
/*
* Trimming trailing spaces off of both strings can cause a string
* with a character less than a space to compare greater than a
* space-extended string, e.g. this returns false:
* SELECT E'ab\n'::CHAR(10) < E'ab '::CHAR(10);
* even though '\n' is less than the space if CHAR(10) was
* space-extended. The correct solution would be to trim only
* the longer string to be the same length of the shorter, if
* possible, then do the comparison. However, changing this
* might break existing indexes, breaking binary upgrades.
* For details, see http://www.postgresql.org/message-id/CAK+WP1xdmyswEehMuetNztM4H199Z1w9KWRHVMKzyyFM+hV=zA@mail.gmail.com
*/
len1
=
bcTruelen
(
arg1
);
len2
=
bcTruelen
(
arg2
);
...
...
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