blob: 4ae0fcbfcc4ee2d046be5ad3ee3d1e07d171d1ab [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
UPDATE TABLE test SET attr = 1
--
ERROR: syntax error (1 : 8)
UPDATE TABLE test SET attr = 1
^
==
UPDATE TABLE SET attr = 1
--
ERROR: syntax error (1 : 8)
UPDATE TABLE SET attr = 1
^
==
UPDATE test SET attr1 = 1, attr2=5, attr3 = 4 WHERE attr2 < 1 AND attr1 > 5 AND attr1+1<2*attr2
--
UpdateStatement[relation_name=test]
+-where_predicate=And
| +-Less
| | +-left_operand=AttributeReference[attribute_name=attr2]
| | +-right_operand=Literal
| | +-NumericLiteral[numeric_string=1,float_like=false]
| +-Greater
| | +-left_operand=AttributeReference[attribute_name=attr1]
| | +-right_operand=Literal
| | +-NumericLiteral[numeric_string=5,float_like=false]
| +-Less
| +-left_operand=Add
| | +-left_operand=AttributeReference[attribute_name=attr1]
| | +-right_operand=Literal
| | +-NumericLiteral[numeric_string=1,float_like=false]
| +-right_operand=Multiply
| +-left_operand=Literal
| | +-NumericLiteral[numeric_string=2,float_like=false]
| +-right_operand=AttributeReference[attribute_name=attr2]
+-assignment=
+-AttributeAssignment[attribute_name=attr1]
| +-value=Literal
| +-NumericLiteral[numeric_string=1,float_like=false]
+-AttributeAssignment[attribute_name=attr2]
| +-value=Literal
| +-NumericLiteral[numeric_string=5,float_like=false]
+-AttributeAssignment[attribute_name=attr3]
+-value=Literal
+-NumericLiteral[numeric_string=4,float_like=false]
==
UPDATE test SET attr = 4+1
--
UpdateStatement[relation_name=test]
+-assignment=
+-AttributeAssignment[attribute_name=attr]
+-value=Add
+-left_operand=Literal
| +-NumericLiteral[numeric_string=4,float_like=false]
+-right_operand=Literal
+-NumericLiteral[numeric_string=1,float_like=false]
==
UPDATE test WHERE attr2=1
--
ERROR: syntax error (1 : 13)
UPDATE test WHERE attr2=1
^