From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 30F306DB00; Sat, 21 Aug 2021 03:27:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 30F306DB00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629505652; bh=mfaDY1VLEnZIM11+GGrogexhqWvEf+PPbU5NmuCeX9s=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=gxK7tLAC4WHhaqTyu//MAoko2401W1bjYpyEGCClaxTyc3fTM0/UOK+IhFVsxOGsf MvVmeUmG4iGVw+mE4Gi3KGhXOQ+eTn4yzqGT22e12+2eucVKGPaySEPkqtKVMh3VTq q4lgJPHuLxHjb4CDifldadoNPM2wid77TbNW84Xw= Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EFA626DB00 for ; Sat, 21 Aug 2021 03:27:29 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EFA626DB00 Received: by smtp53.i.mail.ru with esmtpa (envelope-from ) id 1mHErA-0006Bh-8v; Sat, 21 Aug 2021 03:27:28 +0300 To: Vladimir Davydov , imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: <6f4f310f2d43267c4264844cd966641ce70e804b.1629297142.git.imeevma@gmail.com> <20210819083514.i4hlig526gy6domj@esperanza> Message-ID: Date: Sat, 21 Aug 2021 03:27:13 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210819083514.i4hlig526gy6domj@esperanza> Content-Type: multipart/mixed; boundary="------------C260D7690A581485B9012E9C" Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD906AB4890CDABF0C5CB76CEE71D3E4007182A05F538085040972D12E6EBD44353FD07FAA04A74F4361C411C422EFD389E412EE32A91520F59 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE79D9C320A40CA82D4EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637416EC277BB71E4518638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D81B18CBE784EEF169869F5E2FDE6FB4A8117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE4B6963042765DA4BC5236E9430F51F07D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE3FE4D9CDE3FF759CF9735652A29929C6CC4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F790063788B3B24285A3CD0EEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B50521BF66D21CB8A7076EB18B60F6149B32 X-C1DE0DAB: 0D63561A33F958A505CA10716933215A2572693704BF6AC90A4600AA9809E95DD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75601EFBC916B793DF410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34AEC7C2AC3C44791D0D2D6515DD81CEB9A94B212A1CF2625DE7F44D2B7E808713185AFEE18290698C1D7E09C32AA3244CB0294B9CC29AD87B0C60ECC94698C3F560759606DA2E136AFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojzcVJReGZsqOu7Mn8a9hTtQ== X-Mailru-Sender: B5B6A6EBBD94DAD8D501DDE8C9949A74846200566F000131B4B417B70EECC1390353DEEB2CAAE2D25C2808D6142752370A8ED71B308007E3DC85537438B7E1A423D748DE48713E689437F6177E88F7363CDA0F3B3F5B9367 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 2/5] sql: introduce SQL built-in functions to parser X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Safin Timur via Tarantool-patches Reply-To: Safin Timur Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" This is a multi-part message in MIME format. --------------C260D7690A581485B9012E9C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 19.08.2021 11:35, Vladimir Davydov via Tarantool-patches wrote: > On Wed, Aug 18, 2021 at 05:34:59PM +0300, imeevma@tarantool.org wrote: >> diff --git a/extra/mkkeywordhash.c b/extra/mkkeywordhash.c >> index 0d998506c..369d9e1dd 100644 >> --- a/extra/mkkeywordhash.c >> +++ b/extra/mkkeywordhash.c >> @@ -184,7 +184,6 @@ static Keyword aKeywordTable[] = { >> { "BLOB", "TK_STANDARD", true }, >> { "BINARY", "TK_ID", true }, >> { "CALL", "TK_STANDARD", true }, >> - { "CHAR", "TK_CHAR", true }, >> { "CHARACTER", "TK_ID", true }, >> { "CONDITION", "TK_STANDARD", true }, >> { "CONNECT", "TK_STANDARD", true }, >> @@ -251,6 +250,42 @@ static Keyword aKeywordTable[] = { >> { "LEADING", "TK_LEADING", true }, >> { "TRAILING", "TK_TRAILING", true }, >> { "BOTH", "TK_BOTH", true }, >> + { "ABS", "TK_ABS", true }, >> + { "AVG", "TK_AVG", true }, >> + { "CHAR", "TK_CHAR", true }, >> + { "CHAR_LENGTH", "TK_CHAR_LEN", true }, >> + { "CHARACTER_LENGTH", "TK_CHAR_LEN", true }, >> + { "COALESCE", "TK_COALESCE", true }, >> + { "COUNT", "TK_COUNT", true }, >> + { "GREATEST", "TK_GREATEST", true }, >> + { "GROUP_CONCAT", "TK_GROUP_CONCAT",true }, >> + { "HEX", "TK_HEX", true }, >> + { "IFNULL", "TK_IFNULL", true }, >> + { "LEAST", "TK_LEAST", true }, >> + { "LENGTH", "TK_LENGTH", true }, >> + { "LIKELIHOOD", "TK_LIKELIHOOD", true }, >> + { "LIKELY", "TK_LIKELY", true }, >> + { "LOWER", "TK_LOWER", true }, >> + { "MAX", "TK_MAX", true }, >> + { "MIN", "TK_MIN", true }, >> + { "NULLIF", "TK_NULLIF", true }, >> + { "POSITION", "TK_POSITION", true }, >> + { "PRINTF", "TK_PRINTF", true }, >> + { "QUOTE", "TK_QUOTE", true }, >> + { "RANDOM", "TK_RANDOM", true }, >> + { "RANDOMBLOB", "TK_RANDOMBLOB", true }, >> + { "ROUND", "TK_ROUND", true }, >> + { "ROW_COUNT", "TK_ROW_COUNT", true }, >> + { "SOUNDEX", "TK_SOUNDEX", true }, >> + { "SUBSTR", "TK_SUBSTR", true }, >> + { "SUM", "TK_SUM", true }, >> + { "TOTAL", "TK_TOTAL", true }, >> + { "TYPEOF", "TK_TYPEOF", true }, >> + { "UNICODE", "TK_UNICODE", true }, >> + { "UNLIKELY", "TK_UNLIKELY", true }, >> + { "UPPER", "TK_UPPER", true }, >> + { "VERSION", "TK_VERSION", true }, >> + { "ZEROBLOB", "TK_ZEROBLOB", true }, > > Should be sorted? They all made reserved (last true) - that's one of a problems in a patch. > >> }; >> >> /* Number of keywords */ >> diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y >> index bd041e862..cb2e627db 100644 >> --- a/src/box/sql/parse.y >> +++ b/src/box/sql/parse.y >> @@ -1172,27 +1172,506 @@ trim_specification(A) ::= LEADING. { A = > TRIM_LEADING; } >> trim_specification(A) ::= TRAILING. { A = TRIM_TRAILING; } >> trim_specification(A) ::= BOTH. { A = TRIM_BOTH; } >> >> -expr(A) ::= id(X) LP distinct(D) exprlist(Y) RP(E). { >> - if( Y && Y->nExpr>pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG] ){ >> - const char *err = >> - tt_sprintf("Number of arguments to function %.*s", X.n, X.z); >> - diag_set(ClientError, ER_SQL_PARSER_LIMIT, err, Y->nExpr, >> - pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]); >> +expr(A) ::= ABS(X) LP distinct(D) exprlist(Y) RP(E). { >> + if (Y == NULL || Y->nExpr != 1) { >> + int n = Y == NULL ? 0 : Y->nExpr; >> + diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, "ABS", "1", n); >> pParse->is_aborted = true; >> + return; >> } >> A.pExpr = sqlExprFunction(pParse, Y, &X); >> - spanSet(&A,&X,&E); >> - if( D==SF_Distinct && A.pExpr ){ >> + spanSet(&A, &X, &E); >> + if(D == SF_Distinct && A.pExpr) >> A.pExpr->flags |= EP_Distinct; >> +} >> + >> +expr(A) ::= AVG(X) LP distinct(D) exprlist(Y) RP(E). { >> + if (Y == NULL || Y->nExpr != 1) { >> + int n = Y == NULL ? 0 : Y->nExpr; >> + diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, "AVG", "1", n); >> + pParse->is_aborted = true; >> + return; >> } >> + A.pExpr = sqlExprFunction(pParse, Y, &X); >> + spanSet(&A, &X, &E); >> + if(D == SF_Distinct && A.pExpr) >> + A.pExpr->flags |= EP_Distinct; >> } >> >> -/* >> - * type_func(A) ::= DATE(A) . >> - * type_func(A) ::= DATETIME(A) . >> - */ >> -type_func(A) ::= CHAR(A) . >> -expr(A) ::= type_func(X) LP distinct(D) exprlist(Y) RP(E). { >> +expr(A) ::= CHAR(X) LP distinct(D) exprlist(Y) RP(E). { >> + if (Y != NULL && Y->nExpr > > pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]) { >> + const char *str = tt_sprintf("from %d to %d", 0, >> + > pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]); >> + diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, "CHAR", str, > Y->nExpr); >> + pParse->is_aborted = true; >> + return; >> + } >> + A.pExpr = sqlExprFunction(pParse, Y, &X); >> + spanSet(&A, &X, &E); >> + if(D == SF_Distinct && A.pExpr) >> + A.pExpr->flags |= EP_Distinct; >> +} >> + >> +expr(A) ::= CHAR_LEN(X) LP distinct(D) exprlist(Y) RP(E). { >> + if (Y == NULL || Y->nExpr != 1) { >> + int n = Y == NULL ? 0 : Y->nExpr; >> + const char *name = X.n == strlen("CHAR_LENGTH") ? "CHAR_LENGTH" : >> + "CHARACTER_LENGTH"; >> + diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, name, "1", n); >> + pParse->is_aborted = true; >> + return; >> + } >> + A.pExpr = sqlExprFunction(pParse, Y, &X); >> + spanSet(&A, &X, &E); >> + if(D == SF_Distinct && A.pExpr) >> + A.pExpr->flags |= EP_Distinct; >> +} >> + >> +expr(A) ::= COALESCE(X) LP distinct(D) exprlist(Y) RP(E). { >> + if (Y == NULL || Y->nExpr < 2 || >> + Y->nExpr > pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]) { >> + int n = Y == NULL ? 0 : Y->nExpr; >> + const char *str = tt_sprintf("from %d to %d", 2, >> + > pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]); >> + diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, "COALESCE", str, n); >> + pParse->is_aborted = true; >> + return; >> + } >> + A.pExpr = sqlExprFunction(pParse, Y, &X); >> + spanSet(&A, &X, &E); >> + if(D == SF_Distinct && A.pExpr) >> + A.pExpr->flags |= EP_Distinct; >> +} > > Can you the code to a helper function to avoid copy-paste? Yup, a lot of copy-paste. Hard to distibgush the core of each. This all could make significantly shorter: ------------------------------------------------------------------- expr(A) ::= builtin_fn(X) LP distinct(D) exprlist(Y) RP(E). { /* variable number of arguments */ int args = X.args, maxargs = X.maxargs; int n = Y == NULL ? 0 : Y->nExpr; if (X.vararg) { int limit_args = pParse->db->aLimit[SQL_LIMIT_FUNCTION_ARG]; /* less than minimal # of expected or more than maximal */ if (n < args || n > limit_args) { const char *str = tt_sprintf("from %d to %d", 0, limit_args); diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, TOKEN_STR(X.token), str, Y->nExpr); pParse->is_aborted = true; return; } } else { /* not expected number - args */ if (maxargs == 0 && n != args) { diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, TOKEN_STR(X.token), tt_sprintf("%d", args), n); pParse->is_aborted = true; return; } /* from args till maxargs */ if (n < args || (maxargs != 0 && n > maxargs)) {/* or more than expected */ const char *str = tt_sprintf("from %d to %d", args, maxargs); diag_set(ClientError, ER_FUNC_WRONG_ARG_COUNT, TOKEN_STR(X.token), str, n); pParse->is_aborted = true; return; } } A.pExpr = sql_expr_new_built_in(pParse, Y, &X.token, X.id); spanSet(&A, &X.token, &E); if (D == SF_Distinct && A.pExpr) A.pExpr->flags |= EP_Distinct; } %type builtin_fn {struct builtin_fn_def} builtin_fn(A) ::= ABS(T). { FUNC_ARG_N(A, T, TK_ABS, 1); } builtin_fn(A) ::= AVG(T). { FUNC_ARG_N(A, T, TK_AVG, 1); } builtin_fn(A) ::= CHAR(T). { FUNC_ARG_VAR(A, T, TK_CHAR); } builtin_fn(A) ::= CHAR_LEN(T). { FUNC_ARG_N(A, T, TK_CHAR_LENGTH, 1); } builtin_fn(A) ::= COALESCE(T). { FUNC_ARG_VAR_N(A, T, TK_COALESCE, 2); } /*builtin_fn(A) ::=(T) COUNT. { FUNC_ARG_N(A, T, TK_COUNT, 1); }*/ builtin_fn(A) ::= GREATEST(T). { FUNC_ARG_VAR_N(A, T, TK_GREATEST, 2); } builtin_fn(A) ::= GROUP_CONCAT(T). { FUNC_ARG_N_M(A, T, TK_GROUP_CONCAT, 1, 2); } .... ------------------------------------------------------------------- More details you could see in apatch attached. > >> diff --git a/test/box/tx_man.result b/test/box/tx_man.result >> index 786d7fc30..b99fbc2ca 100644 >> --- a/test/box/tx_man.result >> +++ b/test/box/tx_man.result >> @@ -2129,11 +2129,11 @@ tx1:rollback() >> >> -- gh-6095: SQL query may crash in MVCC mode if it involves ephemeral > spaces. >> -- >> -box.execute([[ CREATE TABLE test (id INT NOT NULL PRIMARY KEY, count > INT NOT NULL)]]) >> +box.execute([[ CREATE TABLE test (id INT NOT NULL PRIMARY KEY, "COUNT" > INT NOT NULL)]]) >> | --- >> | - row_count: 1 >> | ... >> -box.execute([[ UPDATE test SET count = count + 1 WHERE id = 0 ]]) >> +box.execute([[ UPDATE test SET "COUNT" = "COUNT" + 1 WHERE id = 0 ]]) > > This looks bad. MySQL and PostgreSQL allow that. I've fixed it in a patch suggested... > >> | --- >> | - row_count: 0 >> | ... >> diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua >> index e7b35c9d9..7dd85025a 100755 >> --- a/test/sql-tap/func.test.lua >> +++ b/test/sql-tap/func.test.lua >> @@ -68,7 +68,7 @@ test:do_catchsql_test( >> SELECT length(*) FROM tbl1 ORDER BY t1 >> ]], { >> -- >> - 1, "Wrong number of arguments is passed to LENGTH(): expected > 1, got 0" >> + 1, "Syntax error at line 1 near '*'" > > This is probably okay. > >> -- >> }) >> >> @@ -2483,7 +2483,7 @@ test:do_catchsql_test( >> SELECT coalesce() >> ]], { >> -- >> - 1, "Wrong number of arguments is passed to COALESCE(): expected > at least two, got 0" >> + 1, "Wrong number of arguments is passed to COALESCE(): expected > from 2 to 127, got 0" > > And this too. > [Patch attached is for branch imeevma/gh-6105-check-types-no-test] Best Regards, Timur --------------C260D7690A581485B9012E9C Content-Type: text/plain; charset=UTF-8; name="0001-sql-handle-sql-builtins-in-parser.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-sql-handle-sql-builtins-in-parser.patch" RnJvbSBmMDYyMzNhMDJhMjJhZDBkNWQ5N2Y2YzlmZGNjZjU4ZTUzNjE4MmEzIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpNZXNzYWdlLUlkOiA8ZjA2MjMzYTAyYTIyYWQwZDVkOTdmNmM5 ZmRjY2Y1OGU1MzYxODJhMy4xNjI5NTA1MzAwLmdpdC50c2FmaW5AdGFyYW50b29sLm9yZz4K RnJvbTogVGltdXIgU2FmaW4gPHRzYWZpbkB0YXJhbnRvb2wub3JnPgpEYXRlOiBTYXQsIDIx IEF1ZyAyMDIxIDAxOjM0OjE3ICswMzAwClN1YmplY3Q6IFtQQVRDSF0gc3FsOiBoYW5kbGUg c3FsIGJ1aWx0aW5zIGluIHBhcnNlcgpUbzogaW1lZXZtYUB0YXJhbnRvb2wub3JnCgpSZWZh Y3RvcmVkIGEgd2F5IGhvdyBidWlsdGlucyBkZWNsYXJlZCBpbiBwYXJzZS55OgotIG1hZGUg aGFuZGxpbmcgY29kZSB0byBub3QgZHVwbGljYXRlIGluIGVhY2ggY2FzZTsKLSBwcm9wZXJs eSBpbml0aWFsaXplZCBpZCBmYWxsYmFjayBzbyB0aGV5IGFsbAogIGNvdWxkIGJlIHVzZWQg aW4gbm9uLWZ1bmN0aW9ucyBjb250ZXh0LgotLS0KIGV4dHJhL21ra2V5d29yZGhhc2guYyAg ICB8ICA3MiArKy0tLQogc3JjL2JveC9zcWwvcGFyc2UueSAgICAgIHwgNTcxICsrKysrKy0t LS0tLS0tLS0tLS0tLS0tLS0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iwgICAgdHJ1ZSAgfSwK LSAgeyAiQ09BTEVTQ0UiLCAgICAgICAgICAgICAgICJUS19DT0FMRVNDRSIsICAgIHRydWUg IH0sCi0gIHsgIkNPVU5UIiwgICAgICAgICAgICAgICAgICAiVEtfQ09VTlQiLCAgICAgICB0 cnVlICB9LAotICB7ICJHUkVBVEVTVCIsICAgICAgICAgICAgICAgIlRLX0dSRUFURVNUIiwg ICAgdHJ1ZSAgfSwKLSAgeyAiR1JPVVBfQ09OQ0FUIiwgICAgICAgICAgICJUS19HUk9VUF9D T05DQVQiLHRydWUgIH0sCi0gIHsgIkhFWCIsICAgICAgICAgICAgICAgICAgICAiVEtfSEVY IiwgICAgICAgICB0cnVlICB9LAotICB7ICJJRk5VTEwiLCAgICAgICAgICAgICAgICAgIlRL X0lGTlVMTCIsICAgICAgdHJ1ZSAgfSwKLSAgeyAiTEVBU1QiLCAgICAgICAgICAgICAgICAg ICJUS19MRUFTVCIsICAgICAgIHRydWUgIH0sCi0gIHsgIkxFTkdUSCIsICAgICAgICAgICAg ICAgICAiVEtfTEVOR1RIIiwgICAgICB0cnVlICB9LAotICB7ICJMSUtFTElIT09EIiwgICAg ICAgICAgICAgIlRLX0xJS0VMSUhPT0QiLCAgdHJ1ZSAgfSwKLSAgeyAiTElLRUxZIiwgICAg ICAgICAgICAgICAgICJUS19MSUtFTFkiLCAgICAgIHRydWUgIH0sCi0gIHsgIkxPV0VSIiwg ICAgICAgICAgICAgICAgICAiVEtfTE9XRVIiLCAgICAgICB0cnVlICB9LAotICB7ICJNQVgi LCAgICAgICAgICAgICAgICAgICAgIlRLX01BWCIsICAgICAgICAgdHJ1ZSAgfSwKLSAgeyAi TUlOIiwgICAgICAgICAgICAgICAgICAgICJUS19NSU4iLCAgICAgICAgIHRydWUgIH0sCi0g IHsgIk5VTExJRiIsICAgICAgICAgICAgICAgICAiVEtfTlVMTElGIiwgICAgICB0cnVlICB9 LAotICB7ICJQT1NJVElPTiIsICAgICAgICAgICAgICAgIlRLX1BPU0lUSU9OIiwgICAgdHJ1 ZSAgfSwKLSAgeyAiUFJJTlRGIiwgICAgICAgICAgICAgICAgICJUS19QUklOVEYiLCAgICAg IHRydWUgIH0sCi0gIHsgIlFVT1RFIiwgICAgICAgICAgICAgICAgICAiVEtfUVVPVEUiLCAg ICAgICB0cnVlICB9LAotICB7ICJSQU5ET00iLCAgICAgICAgICAgICAgICAgIlRLX1JBTkRP TSIsICAgICAgdHJ1ZSAgfSwKLSAgeyAiUkFORE9NQkxPQiIsICAgICAgICAgICAgICJUS19S QU5ET01CTE9CIiwgIHRydWUgIH0sCi0gIHsgIlJPVU5EIiwgICAgICAgICAgICAgICAgICAi VEtfUk9VTkQiLCAgICAgICB0cnVlICB9LAotICB7ICJST1dfQ09VTlQiLCAgICAgICAgICAg ICAgIlRLX1JPV19DT1VOVCIsICAgdHJ1ZSAgfSwKLSAgeyAiU09VTkRFWCIsICAgICAgICAg ICAgICAgICJUS19TT1VOREVYIiwgICAgIHRydWUgIH0sCi0gIHsgIlNVQlNUUiIsICAgICAg ICAgICAgICAgICAiVEtfU1VCU1RSIiwgICAgICB0cnVlICB9LAotICB7ICJTVU0iLCAgICAg ICAgICAgICAgICAgICAgIlRLX1NVTSIsICAgICAgICAgdHJ1ZSAgfSwKLSAgeyAiVE9UQUwi LCAgICAgICAgICAgICAgICAgICJUS19UT1RBTCIsICAgICAgIHRydWUgIH0sCi0gIHsgIlRZ UEVPRiIsICAgICAgICAgICAgICAgICAiVEtfVFlQRU9GIiwgICAgICB0cnVlICB9LAotICB7 ICJVTklDT0RFIiwgICAgICAgICAgICAgICAgIlRLX1VOSUNPREUiLCAgICAgdHJ1ZSAgfSwK LSAgeyAiVU5MSUtFTFkiLCAgICAgICAgICAgICAgICJUS19VTkxJS0VMWSIsICAgIHRydWUg IH0sCi0gIHsgIlVQUEVSIiwgICAgICAgICAgICAgICAgICAiVEtfVVBQRVIiLCAgICAgICB0 cnVlICB9LAotICB7ICJWRVJTSU9OIiwgICAgICAgICAgICAgICAgIlRLX1ZFUlNJT04iLCAg ICAgdHJ1ZSAgfSwKLSAgeyAiWkVST0JMT0IiLCAgICAgICAgICAgICAgICJUS19aRVJPQkxP QiIsICAgIHRydWUgIH0sCisgIHsgIkFCUyIsICAgICAgICAgICAgICAgICAgICAiVEtfQUJT IiwgICAgICAgICBmYWxzZSB9LAorICB7ICJBVkciLCAgICAgICAgICAgICAgICAgICAgIlRL X0FWRyIsICAgICAgICAgZmFsc2UgfSwKKyAgeyAiQ0hBUiIsICAgICAgICAgICAgICAgICAg ICJUS19DSEFSIiwgICAgICAgIGZhbHNlIH0sCisgIHsgIkNIQVJfTEVOR1RIIiwgICAgICAg ICAgICAiVEtfQ0hBUl9MRU4iLCAgICBmYWxzZSB9LAorICB7ICJDSEFSQUNURVJfTEVOR1RI IiwgICAgICAgIlRLX0NIQVJfTEVOIiwgICAgZmFsc2UgfSwKKyAgeyAiQ09BTEVTQ0UiLCAg ICAgICAgICAgICAgICJUS19DT0FMRVNDRSIsICAgIGZhbHNlIH0sCisgIHsgIkNPVU5UIiwg ICAgICAgICAgICAgICAgICAiVEtfQ09VTlQiLCAgICAgICBmYWxzZSB9LAorICB7ICJHUkVB VEVTVCIsICAgICAgICAgICAgICAgIlRLX0dSRUFURVNUIiwgICAgZmFsc2UgfSwKKyAgeyAi R1JPVVBfQ09OQ0FUIiwgICAgICAgICAgICJUS19HUk9VUF9DT05DQVQiLGZhbHNlIH0sCisg IHsgIkhFWCIsICAgICAgICAgICAgICAgICAgICAiVEtfSEVYIiwgICAgICAgICBmYWxzZSB9 LAorICB7ICJJRk5VTEwiLCAgICAgICAgICAgICAgICAgIlRLX0lGTlVMTCIsICAgICAgZmFs c2UgfSwKKyAgeyAiTEVBU1QiLCAgICAgICAgICAgICAgICAgICJUS19MRUFTVCIsICAgICAg IGZhbHNlIH0sCisgIHsgIkxFTkdUSCIsICAgICAgICAgICAgICAgICAiVEtfTEVOR1RIIiwg ICAgICBmYWxzZSB9LAorICB7ICJMSUtFTElIT09EIiwgICAgICAgICAgICAgIlRLX0xJS0VM SUhPT0QiLCAgZmFsc2UgfSwKKyAgeyAiTElLRUxZIiwgICAgICAgICAgICAgICAgICJUS19M SUtFTFkiLCAgICAgIGZhbHNlIH0sCisgIHsgIkxPV0VSIiwgICAgICAgICAgICAgICAgICAi VEtfTE9XRVIiLCAgICAgICBmYWxzZSB9LAorICB7ICJNQVgiLCAgICAgICAgICAgICAgICAg ICAgIlRLX01BWCIsICAgICAgICAgZmFsc2UgfSwKKyAgeyAiTUlOIiwgICAgICAgICAgICAg ICAgICAgICJUS19NSU4iLCAgICAgICAgIGZhbHNlIH0sCisgIHsgIk5VTExJRiIsICAgICAg ICAgICAgICAgICAiVEtfTlVMTElGIiwgICAgICBmYWxzZSB9LAorICB7ICJQT1NJVElPTiIs ICAgICAgICAgICAgICAgIlRLX1BPU0lUSU9OIiwgICAgZmFsc2UgfSwKKyAgeyAiUFJJTlRG IiwgICAgICAgICAgICAgICAgICJUS19QUklOVEYiLCAgICAgIGZhbHNlIH0sCisgIHsgIlFV T1RFIiwgICAgICAgICAgICAgICAgICAiVEtfUVVPVEUiLCAgICAgICBmYWxzZSB9LAorICB7 ICJSQU5ET00iLCAgICAgICAgICAgICAgICAgIlRLX1JBTkRPTSIsICAgICAgZmFsc2UgfSwK KyAgeyAiUkFORE9NQkxPQiIsICAgICAgICAgICAgICJUS19SQU5ET01CTE9CIiwgIGZhbHNl IH0sCisgIHsgIlJPVU5EIiwgICAgICAgICAgICAgICAgICAiVEtfUk9VTkQiLCAgICAgICBm YWxzZSB9LAorICB7ICJST1dfQ09VTlQiLCAgICAgICAgICAgICAgIlRLX1JPV19DT1VOVCIs ICAgZmFsc2UgfSwKKyAgeyAiU09VTkRFWCIsICAgICAgICAgICAgICAgICJUS19TT1VOREVY IiwgICAgIGZhbHNlIH0sCisgIHsgIlNVQlNUUiIsICAgICAgICAgICAgICAgICAiVEtfU1VC U1RSIiwgICAgICBmYWxzZSB9LAorICB7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ciwgbik7 Ci0gICAgcFBhcnNlLT5pc19hYm9ydGVkID0gdHJ1ZTsKLSAgICByZXR1cm47CisgICAgLyog bGVzcyB0aGFuIG1pbmltYWwgIyBvZiBleHBlY3RlZCBvciBtb3JlIHRoYW4gbWF4aW1hbCAq LworICAgIGlmIChuIDwgYXJncyB8fCBuID4gbGltaXRfYXJncykgeyAKKyAgICAgIGNvbnN0 IGNoYXIgKnN0ciA9IHR0X3NwcmludGYoImZyb20gJWQgdG8gJWQiLCAwLCBsaW1pdF9hcmdz KTsKKyAgICAgIGRpYWdfc2V0KENsaWVudEVycm9yLCBFUl9GVU5DX1dST05HX0FSR19DT1VO VCwKKyAgICAgICAgICAgICAgICBUT0tFTl9TVFIoWC50b2tlbiksIHN0ciwgWS0+bkV4cHIp OworICAgICAgcFBhcnNlLT5pc19hYm9ydGVkID0gdHJ1ZTsKKyAgICAgIHJldHVybjsKKyAg ICB9CisgIH0gZWxzZSB7CisgICAgLyogbm90IGV4cGVjdGVkIG51bWJlciAtIGFyZ3MgKi8K KyAgICBpZiAobWF4YXJncyA9PSAwICYmIG4gIT0gYXJncykgeworICAgICAgZGlhZ19zZXQo Q2xpZW50RXJyb3IsIEVSX0ZVTkNfV1JPTkdfQVJHX0NPVU5ULCBUT0tFTl9TVFIoWC50b2tl biksCisgICAgICAgICAgICAgIHR0X3NwcmludGYoIiVkIiwgYXJncyksIG4pOworICAgICAg cFBhcnNlLT5pc19hYm9ydGVkID0gdHJ1ZTsKKyAgICAgIHJldHVybjsKKyAgICB9CisgICAg LyogZnJvbSBhcmdzIHRpbGwgbWF4YXJncyAgKi8KKyAgICBpZiAobiA8IGFyZ3MgfHwgKG1h eGFyZ3MgIT0gMCAmJiBuID4gbWF4YXJncykpIHsvKiBvciBtb3JlIHRoYW4gZXhwZWN0ZWQg Ki8KKyAgICAgIGNvbnN0IGNoYXIgKnN0ciA9IHR0X3NwcmludGYoImZyb20gJWQgdG8gJWQi LCBhcmdzLCBtYXhhcmdzKTsKKy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tZW50cyAqLworCWJvb2wgdmFyYXJnOworCS8qKiBmb3Ig dmFyaWFyZ3MgPSBtaW5pbWFsIG51bWJlciBvZiBhcmd1bWVudHMgCisJICogIG90aGVyd2lz ZSAtIGV4YXQgbnVtYmVyIG9mIGFyZ3VtZW50cyAKKwkgKi8KKwlpbnQgYXJnczsKKwkvKiog bWF4aW11bSAjIG9mIGFyZ3VtZW50cyBpZiBkZWZpbmVkCisJICogb3RoZXJ3aXNlIHNob3Vs ZCBiZSBldXFhbCB0byBhcmdzCisJICovCisJIGludCBtYXhhcmdzOworfTsKKworI2RlZmlu ZSBUT0tFTl9TVFIodG9rZW4pICAgIHR0X3NwcmludGYoIiUuKnMiLCAodG9rZW4pLm4sICh0 b2tlbikueikKKworLyoqIGV4YWN0bHkgTiBhcmdzLCBtb3N0IGZyZXF1ZW50bHkgTj09MSAq LworI2RlZmluZSBGVU5DX0FSR19OKEEsIFQsIHQsIE4pIHsgICAgICBcCisJQS5pZCA9IHQ7 ICAgICAgICAgICAgICAgICAgICAgXAorCUEudG9rZW4gPSBUOyAgICAgICAgICAgICAgICAg IFwKKwlBLnZhcmFyZyA9IGZhbHNlOyAgICAgICAgICAgICBcCisJQS5hcmdzID0gIE47ICAg ICAgICAgICAgICAgICAgXAorCUEubWF4YXJncyA9IDA7ICAgICAgICAgICAgICAgIFwKK30K KworLyoqIGZyb20gTiwgdG8gTSBudW1iZXIgb2YgYXJncyAqLworI2RlZmluZSBGVU5DX0FS R19OX00oQSwgVCwgdCwgTiwgTSkgeyBcCisJQS5pZCA9IHQ7ICAgICAgICAgICAgICAgICAg ICAgXAorCUEudG9rZW4gPSBUOyAgICAgICAgICAgICAgICAgIFwKKwlBLnZhcmFyZyA9IGZh bHNlOyAgICAgICAgICAgICBcCisJQS5hcmdzID0gTjsgICAgICAgICAgICAgICAgICAgXAor CUEubWF4YXJncyA9IE07ICAgICAgICAgICAgICAgIFwKK30KKworLyoqIHZhcmlhYmxlICMg b2YgYXJncyAqLworI2Rl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