From: Kirill Shcherbatov <kshcherbatov@tarantool.org>
To: tarantool-patches@freelists.org
Cc: v.shpilevoy@tarantool.org,
Kirill Shcherbatov <kshcherbatov@tarantool.org>
Subject: [tarantool-patches] [PATCH v4 1/7] sql: fix code style in sqlite3Pragma
Date: Sat, 28 Apr 2018 21:26:52 +0300 [thread overview]
Message-ID: <d96f1471b4197b2562e4f3107e8992369f4c3fb6.1524939874.git.kshcherbatov@tarantool.org> (raw)
In-Reply-To: <cover.1524939874.git.kshcherbatov@tarantool.org>
In-Reply-To: <cover.1524939874.git.kshcherbatov@tarantool.org>
---
src/box/sql/pragma.c | 56 +++++++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 29 deletions(-)
diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
index e41f69b..4a68cad 100644
--- a/src/box/sql/pragma.c
+++ b/src/box/sql/pragma.c
@@ -544,37 +544,35 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */
#ifndef SQLITE_OMIT_FOREIGN_KEY
case PragTyp_FOREIGN_KEY_LIST:{
- if (zRight) {
- FKey *pFK;
- Table *pTab;
- pTab = sqlite3HashFind(&db->pSchema->tblHash,
- zRight);
- if (pTab != NULL) {
- pFK = pTab->pFKey;
- if (pFK) {
- int i = 0;
- pParse->nMem = 8;
- while (pFK) {
- int j;
- for (j = 0;
- j < pFK->nCol;
- j++) {
- sqlite3VdbeMultiLoad(v, 1, "iissssss", i, j, pFK->zTo, pTab->aCol[pFK->aCol[j].iFrom].zName, pFK->aCol[j].zCol, actionName(pFK->aAction[1]), /* ON UPDATE */
- actionName(pFK->aAction[0]), /* ON DELETE */
- "NONE");
- sqlite3VdbeAddOp2
- (v,
- OP_ResultRow,
- 1, 8);
- }
- ++i;
- pFK = pFK->pNextFrom;
- }
- }
- }
- }
+ if (!zRight)
+ break;
+ FKey *pFK;
+ Table *pTab;
+ pTab = sqlite3HashFind(&db->pSchema->tblHash, zRight);
+ if (pTab == NULL)
break;
+ pFK = pTab->pFKey;
+ if (!pFK)
+ break;
+ int i = 0;
+ pParse->nMem = 8;
+ while (pFK) {
+ for (int j = 0; j < pFK->nCol; j++) {
+ const char *name =
+ pTab->aCol[pFK->aCol[j].iFrom].zName;
+ sqlite3VdbeMultiLoad(v, 1, "iissssss", i, j,
+ pFK->zTo, name,
+ pFK->aCol[j].zCol,
+ actionName(pFK->aAction[1]),
+ actionName(pFK->aAction[0]),
+ "NONE");
+ sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 8);
+ }
+ ++i;
+ pFK = pFK->pNextFrom;
}
+ break;
+ }
#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
#ifndef SQLITE_OMIT_FOREIGN_KEY
--
2.7.4
next prev parent reply other threads:[~2018-04-28 18:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-25 16:52 [tarantool-patches] [PATCH v3 0/4] sql: Removed Column fields to server with region allocations Kirill Shcherbatov
2018-04-25 16:52 ` [tarantool-patches] [PATCH v3 1/4] sql: Fix code style in sqlite3Pragma Kirill Shcherbatov
2018-04-26 11:47 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-25 16:52 ` [tarantool-patches] [PATCH v3 2/4] sql: Remove zName and nColumn from SQL Kirill Shcherbatov
2018-04-25 17:10 ` [tarantool-patches] " Kirill Shcherbatov
2018-04-26 12:12 ` Vladislav Shpilevoy
2018-04-26 11:47 ` Vladislav Shpilevoy
2018-04-25 16:52 ` [tarantool-patches] [PATCH v3 3/4] sql: Removed type " Kirill Shcherbatov
2018-04-25 16:52 ` [tarantool-patches] [PATCH v3 4/4] sql: Region-based allocations Kirill Shcherbatov
2018-04-26 11:47 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-26 11:47 ` [tarantool-patches] Re: [PATCH v3 0/4] sql: Removed Column fields to server with region allocations Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 0/7] sql: refactor SQL Parser structures Kirill Shcherbatov
2018-04-28 18:26 ` Kirill Shcherbatov [this message]
2018-05-03 10:10 ` [tarantool-patches] Re: [PATCH v4 1/7] sql: fix code style in sqlite3Pragma Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 2/7] sql: remove zName and nColumn from SQL Kirill Shcherbatov
2018-05-03 10:10 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 3/7] sql: start using type from space_def Kirill Shcherbatov
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 4/7] sql: start using collations and is_nullable " Kirill Shcherbatov
2018-05-03 10:21 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 5/7] sql: move names to server Kirill Shcherbatov
2018-05-03 11:08 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 6/7] sql: start using is_view field from space_def Kirill Shcherbatov
2018-05-03 11:16 ` [tarantool-patches] " Vladislav Shpilevoy
2018-04-28 18:26 ` [tarantool-patches] [PATCH v4 7/7] sql: space_def* instead of Table* in Expr Kirill Shcherbatov
2018-05-03 11:32 ` [tarantool-patches] " Vladislav Shpilevoy
2018-05-03 10:10 ` [tarantool-patches] Re: [PATCH v4 0/7] sql: refactor SQL Parser structures Vladislav Shpilevoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d96f1471b4197b2562e4f3107e8992369f4c3fb6.1524939874.git.kshcherbatov@tarantool.org \
--to=kshcherbatov@tarantool.org \
--cc=tarantool-patches@freelists.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [tarantool-patches] [PATCH v4 1/7] sql: fix code style in sqlite3Pragma' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox