From 7d9af70538cb138aae3566cac2e068b5da1c6720 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 6 Jun 2024 13:06:58 +0300 Subject: [PATCH] ; Fix last change in sqlite.c * etc/NEWS: * doc/lispref/text.texi (Database): * src/sqlite.c (Fsqlite_execute_batch): Fix last change (Bug#70145). (cherry picked from commit 9da2faf73b7f2e773dfb778e49ed90e58a852e43) --- doc/lispref/text.texi | 4 ++-- etc/NEWS | 8 ++++---- src/sqlite.c | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 3d4ce257511..cc7e10684bb 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5425,8 +5425,8 @@ called @var{gif}, you have to mark it specially to let @defun sqlite-execute-batch db statements Execute the @acronym{SQL} @var{statements}. @var{statements} is a string containing 0 or more @acronym{SQL} statements. This command -might be useful when we want to execute multiple @acronym{DDL} -statements. +might be useful when a Lisp program needs to execute multiple Data +Definition Language (@acronym{DDL}) statements in one go. @end defun diff --git a/etc/NEWS b/etc/NEWS index 9b5aa276329..25b7eef5898 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -472,10 +472,10 @@ its shebang line, Emacs will now skip over 'env -S' and deduce the major mode based on the interpreter after 'env -S'. +++ -** New command 'sqlite-execute-batch'. -This command lets the user execute multiple SQL commands in one -command. It is useful when the user wants to evaluate an entire SQL -file. +** New function 'sqlite-execute-batch'. +This function lets the user execute multiple SQL statements in one go. +It is useful, for example, when a Lisp program needs to evaluate an +entire SQL file. +++ diff --git a/src/sqlite.c b/src/sqlite.c index c606fa5f831..53f9d095114 100644 --- a/src/sqlite.c +++ b/src/sqlite.c @@ -647,13 +647,13 @@ sqlite_exec (sqlite3 *sdb, const char *query) } DEFUN ("sqlite-execute-batch", Fsqlite_execute_batch, Ssqlite_execute_batch, 2, 2, 0, - doc: /* Execute multiple SQL statements in DB. -Query is a string containing 0 or more SQL statements. */) - (Lisp_Object db, Lisp_Object query) + doc: /* Execute multiple SQL STATEMENTS in DB. +STATEMENTS is a string containing 0 or more SQL statements. */) + (Lisp_Object db, Lisp_Object statements) { check_sqlite (db, false); - CHECK_STRING (query); - Lisp_Object encoded = encode_string(query); + CHECK_STRING (statements); + Lisp_Object encoded = encode_string (statements); return sqlite_exec (XSQLITE (db)->db, SSDATA (encoded)); } -- 2.39.2