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
7c1e67bd
Commit
7c1e67bd
authored
Aug 04, 2002
by
Thomas G. Lockhart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement IS OF type predicate. Can now do queries of the form:
select value IS OF (integer, float8);
parent
b71310d8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
9 deletions
+44
-9
src/backend/parser/parse_expr.c
src/backend/parser/parse_expr.c
+44
-9
No files found.
src/backend/parser/parse_expr.c
View file @
7c1e67bd
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.12
3 2002/07/18 17:14:19 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.12
4 2002/08/04 06:46:12 thomas
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -282,6 +282,41 @@ transformExpr(ParseState *pstate, Node *expr)
rexpr
);
((
Expr
*
)
result
)
->
opType
=
DISTINCT_EXPR
;
}
break
;
case
OF
:
{
List
*
telem
;
A_Const
*
n
;
Oid
ltype
,
rtype
;
bool
matched
=
FALSE
;
/* Checking an expression for match to type.
* Will result in a boolean constant node.
*/
Node
*
lexpr
=
transformExpr
(
pstate
,
a
->
lexpr
);
ltype
=
exprType
(
lexpr
);
foreach
(
telem
,
(
List
*
)
a
->
rexpr
)
{
rtype
=
LookupTypeName
(
lfirst
(
telem
));
matched
=
(
rtype
==
ltype
);
if
(
matched
)
break
;
}
/* Expect two forms: equals or not equals.
* Flip the sense of the result for not equals.
*/
if
(
strcmp
(
strVal
(
lfirst
(
a
->
name
)),
"!="
)
==
0
)
matched
=
(
!
matched
);
n
=
makeNode
(
A_Const
);
n
->
val
.
type
=
T_String
;
n
->
val
.
val
.
str
=
(
matched
?
"t"
:
"f"
);
n
->
typename
=
SystemTypeName
(
"bool"
);
result
=
transformExpr
(
pstate
,
(
Node
*
)
n
);
}
break
;
}
break
;
}
...
...
@@ -589,14 +624,14 @@ transformExpr(ParseState *pstate, Node *expr)
break
;
}
/
*
/********************************************
*
* Quietly accept node types that may be presented when we are
* called on an already-transformed tree.
*
* Do any other node types need to be accepted? For now we are
* taking a conservative approach, and only accepting node
* types that are demonstrably necessary to accept.
*/
********************************************
*/
case
T_Expr
:
case
T_Var
:
case
T_Const
:
...
...
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