incubator-bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1433919 - /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
Date Wed, 16 Jan 2013 12:56:51 GMT
Author: jure
Date: Wed Jan 16 12:56:51 2013
New Revision: 1433919

URL: http://svn.apache.org/viewvc?rev=1433919&view=rev
Log:
#288 fix, don't fail on INSERTs that don't specify columns


Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py?rev=1433919&r1=1433918&r2=1433919&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/dbcursor.py
Wed Jan 16 12:56:51 2013
@@ -378,13 +378,19 @@ class BloodhoundProductSQLTranslate(obje
             if isinstance(token, Types.Identifier):
                 tablename = token.get_name()
                 columns_token = self._replace_table_entity_name(table_name_token, token,
tablename)
-                insert_extra_column(tablename, columns_token)
-                token = self._token_next(parent, table_name_token)
+                if columns_token.match(Tokens.Keyword, 'VALUES'):
+                    token = columns_token
+                else:
+                    insert_extra_column(tablename, columns_token)
+                    token = self._token_next(parent, table_name_token)
         else:
             tablename = table_name_token.value
             columns_token = self._replace_table_entity_name(parent, table_name_token, tablename)
-            insert_extra_column(tablename, columns_token)
-            token = self._token_next(parent, columns_token)
+            if columns_token.match(Tokens.Keyword, 'VALUES'):
+                token = columns_token
+            else:
+                insert_extra_column(tablename, columns_token)
+                token = self._token_next(parent, columns_token)
         if token.match(Tokens.Keyword, 'VALUES'):
             separators = [',', '(', ')']
             token = self._token_next(parent, token)



Mime
View raw message