You are viewing a plain text version of this content. The canonical link for it is here.
Posted to codereview@trafodion.apache.org by anoopsharma00 <gi...@git.apache.org> on 2018/06/13 23:29:08 UTC
[GitHub] trafodion pull request #1608: jira TRAFODION-1782 Auto assignment of NOT NUL...
GitHub user anoopsharma00 opened a pull request:
https://github.com/apache/trafodion/pull/1608
jira TRAFODION-1782 Auto assignment of NOT NULL attr to primary key cols
details in jira.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/anoopsharma00/trafodion ansharma_nnpk_br
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/trafodion/pull/1608.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1608
----
commit 5724b2e6c1b2a955ee4ab4cd6a582d1d74fd1003
Author: Anoop Sharma <an...@...>
Date: 2018-06-04T18:07:45Z
nonnull pkey, commit #1
commit ba15b2e37c20d2fdc11340e826045c9ce0950571
Author: Anoop Sharma <an...@...>
Date: 2018-06-11T17:14:40Z
Merge remote branch 'origin/master' into ansharma_nnpk_br
Conflicts:
core/sql/regress/seabase/EXPECTED031
core/sql/sqlcomp/CmpDescribe.cpp
core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
core/sql/sqlcomp/DefaultConstants.h
commit bc77872838d0e42766e0e54b7a5c3d2139bb7a5b
Author: Anoop Sharma <an...@...>
Date: 2018-06-11T17:15:00Z
Merge remote branch 'origin/master' into ansharma_nnpk_br
commit a5eb0b26465fce538b2b5c1e054cdc42aa7423ff
Author: Anoop Sharma <an...@...>
Date: 2018-06-13T23:22:18Z
jira TRAFODION-1782 Auto assignment of NOT NULL attr to primary key columns.
details in jira.
regress/seabase/TEST032 has new tests for this enhancement.
----
---
[GitHub] trafodion pull request #1608: jira TRAFODION-1782 Auto assignment of NOT NUL...
Posted by zellerh <gi...@git.apache.org>.
Github user zellerh commented on a diff in the pull request:
https://github.com/apache/trafodion/pull/1608#discussion_r195274939
--- Diff: core/sql/sqlcomp/CmpSeabaseDDLtable.cpp ---
@@ -8047,14 +8149,36 @@ void CmpSeabaseDDL::alterSeabaseTableAddPKeyConstraint(
if (cliRC < 0)
{
cliInterface.retrieveSQLDiagnostics(CmpCommon::diags());
+
+ goto label_return;
}
str_sprintf(cqdbuf, "cqd traf_create_table_with_uid '' ;");
cliInterface.executeImmediate(cqdbuf);
- if (cliRC < 0)
+ str_sprintf(cqdbuf, "cqd traf_no_hbase_drop_create 'OFF';");
+ cliInterface.executeImmediate(cqdbuf);
+
+ if (NOT isEmpty) // non-empty table
{
- return;
+ // remove NATable so current definition could be loaded
+ ActiveSchemaDB()->getNATableDB()->removeNATable
+ (cn,
+ ComQiScope::REMOVE_FROM_ALL_USERS,
+ COM_BASE_TABLE_OBJECT,
+ alterAddConstraint->ddlXns(), FALSE);
+
+ // copy tempTable data into newly created table
+ str_sprintf(buf, "insert with no rollback into %s select * from %s",
--- End diff --
A general question, this also happens in the existing code: When we make a copy of a table in a DDL operation, do we need to make sure that nobody writes data into the table? If there are inserts or updates, what would happen? Could the DDL operation fail with a conflict, or would we potentially lose that data?
---
[GitHub] trafodion pull request #1608: jira TRAFODION-1782 Auto assignment of NOT NUL...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/trafodion/pull/1608
---