Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fyCv9-0000cO-2P for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Sep 2018 09:19:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fyCv6-0001HI-8r for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Sep 2018 09:19:16 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fyCuZ-0006xX-9R for pgsql-hackers@lists.postgresql.org; Fri, 07 Sep 2018 09:18:43 +0000 Received: from sraihb2.sra.co.jp ([202.32.10.6]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fyChQ-0004VX-81 for pgsql-hackers@postgresql.org; Fri, 07 Sep 2018 09:05:09 +0000 Received: from srascf.sra.co.jp (srascf [133.137.8.80]) by sraihb2.sra.co.jp (Postfix) with ESMTP id 8993F2A16CB for ; Fri, 7 Sep 2018 18:05:05 +0900 (JST) Received: from srascb.sra.co.jp (unknown [133.137.8.65]) by srascf.sra.co.jp with smtp id 506e_0846_172b5158_7928_4c23_8a4b_ae9d0882885a; Fri, 07 Sep 2018 18:05:05 +0900 Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id 6CBF42D6942 for ; Fri, 7 Sep 2018 18:05:05 +0900 (JST) Received: from yugon-CFSV7-1 (dhcp-175-183.sra.co.jp [133.137.175.183]) by sranhm.sra.co.jp (Postfix) with SMTP id 56B43A1076 for ; Fri, 7 Sep 2018 18:05:05 +0900 (JST) Date: Fri, 7 Sep 2018 18:05:04 +0900 From: Yugo Nagata To: pgsql-hackers@postgresql.org Subject: Unused argument from execute_sql_string() Message-Id: <20180907180504.1ff19e1675bb44a67e9c7ab1@sraoss.co.jp> X-Mailer: Sylpheed 3.5.0pro2_5_1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__7_Sep_2018_18_05_04_+0900_xqOx5hJwRWsq.9rz" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --Multipart=_Fri__7_Sep_2018_18_05_04_+0900_xqOx5hJwRWsq.9rz Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi, I found that a argument "filename" is not used in execute_sql_string() although the comment says "filename is used only to report errors.", so I think we can remove this argument as done in the patch I attached. Regards, -- Yugo Nagata --Multipart=_Fri__7_Sep_2018_18_05_04_+0900_xqOx5hJwRWsq.9rz Content-Type: text/x-diff; name="execute_sql_string.patch" Content-Disposition: attachment; filename="execute_sql_string.patch" Content-Transfer-Encoding: 7bit diff --git a/src/backend/commands/extension.c b/src/backend/commands/extension.c index 2e4538146d..2d761a5773 100644 --- a/src/backend/commands/extension.c +++ b/src/backend/commands/extension.c @@ -683,8 +683,6 @@ read_extension_script_file(const ExtensionControlFile *control, /* * Execute given SQL string. * - * filename is used only to report errors. - * * Note: it's tempting to just use SPI to execute the string, but that does * not work very well. The really serious problem is that SPI will parse, * analyze, and plan the whole string before executing any of it; of course @@ -694,7 +692,7 @@ read_extension_script_file(const ExtensionControlFile *control, * could be very long. */ static void -execute_sql_string(const char *sql, const char *filename) +execute_sql_string(const char *sql) { List *raw_parsetree_list; DestReceiver *dest; @@ -921,7 +919,7 @@ execute_extension_script(Oid extensionOid, ExtensionControlFile *control, /* And now back to C string */ c_sql = text_to_cstring(DatumGetTextPP(t_sql)); - execute_sql_string(c_sql, filename); + execute_sql_string(c_sql); } PG_CATCH(); { --Multipart=_Fri__7_Sep_2018_18_05_04_+0900_xqOx5hJwRWsq.9rz--