This is an automated email from the ASF dual-hosted git repository.

mblow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git

commit 4b8a47d8d711241b8970cb8cdef186ecb5dffc2c
Author: Ali Alsuliman <[email protected]>
AuthorDate: Thu Mar 11 17:09:06 2021 -0800

    [NO ISSUE][COMP] Issue a warning when a synonym was not created because it 
exists
    
    - user model changes: no
    - storage format changes: no
    - interface changes: no
    
    Details:
    When creating a synonym with IF EXISTS, issue a warning when
    the synonym was not created because it exists.
    
    Change-Id: Iff9ec2f4e28db9824e93a4ab71dcfd85e716fec6
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/10463
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Ali Alsuliman <[email protected]>
    Reviewed-by: Ian Maxon <[email protected]>
---
 .../main/java/org/apache/asterix/app/translator/QueryTranslator.java  | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index 0a88832..64d0fd7 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -2664,6 +2664,10 @@ public class QueryTranslator extends 
AbstractLangTranslator implements IStatemen
             if (synonym != null) {
                 if (css.getIfNotExists()) {
                     MetadataManager.INSTANCE.commitTransaction(mdTxnCtx);
+                    if (warningCollector.shouldWarn()) {
+                        warningCollector
+                                .warn(Warning.of(css.getSourceLocation(), 
ErrorCode.SYNONYM_EXISTS, synonymName));
+                    }
                     return;
                 }
                 throw new CompilationException(ErrorCode.SYNONYM_EXISTS, 
css.getSourceLocation(), synonymName);

Reply via email to