1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-03 16:53:36 +03:00
Commit Graph

574 Commits

Author SHA1 Message Date
drh
af66433625 Remove unused "codec" code from the command-line shell.
FossilOrigin-Name: 37abfe0c1e5da63342389c527a9f7cbe0f8392d9
2013-07-18 20:28:29 +00:00
drh
8dd675e43f Make sure the shell does not try to put a zero terminator on the end of an
unallocated zero-length string when running ".import" on an empty file.

FossilOrigin-Name: 92adaee5bd31c152dbc1592f4aeb5d8da957a1ea
2013-07-12 21:09:24 +00:00
drh
d0a64dc75a Fix an issue in the command-line shell with CSV import of rows with
empty columns.

FossilOrigin-Name: 60b65e5ee3828c2a814bf035b57b3e8681af9397
2013-06-30 20:24:26 +00:00
drh
12cd6cfd6e Fix the build of the command-line shell on windows. Windows uses "_pclose"
rather than "pclose" as the pointer to the function that closes a popen pipe.

FossilOrigin-Name: b003b2b2b6ddbfc6ec508b47904e6d095c5f6940
2013-06-29 15:40:22 +00:00
drh
5bde816599 If the filename argument to the ".import" command in the command-line shell
begins with '|' then treat it as an input pipe rather than a file.

FossilOrigin-Name: 4c02b344f5c6f6fb1c61b79d51063a1e0e2d75c0
2013-06-27 14:07:53 +00:00
drh
4c56b99f2e Improved handling of backslash escapes on double-quoted arguments to
dot-commands in the command-line shell.

FossilOrigin-Name: 656a1fe5dd670e6ce7173ed3ce3392c0151641a0
2013-06-27 13:26:55 +00:00
drh
340f582ec3 The undocumented and unsupported ".selftest" command in the command-line
shell utility is now only available if compiled with SQLITE_DEBUG.  Also
fix a windows compiler warning in that command.

FossilOrigin-Name: e88fd5b22198edfc6f91390194bdde07ca06ba35
2013-06-27 13:01:21 +00:00
drh
db95f68b14 Update the ".import" command of the command-line shell so that it can
accept field values that span multiple lines and so that it issues
error messages if the input text does not strictly conform to RFC4180.

FossilOrigin-Name: 93f632152e464a89322a0130adaf9f342411bf7d
2013-06-26 22:46:00 +00:00
drh
bf159fa21b Add a new (experimental) sqlite3_stmt_status() verb that returns the number
of VM steps.

FossilOrigin-Name: f1366bab737a3ac2ea20a0ec014cc306d7ded8a5
2013-06-25 22:01:22 +00:00
drh
348d19c0c4 Enhance the shell to provide more flexibility when entering numeric arguments
on dot-commands.  In particular, allow hexadecimal arguments to .wheretrace
and .testctrl commands.  Cherrypick from [b9578c371ee5].

FossilOrigin-Name: 3bd5ad095b23102dd3379cb62997cbf23cc67b7a
2013-06-03 12:47:43 +00:00
drh
c2bed0a2c9 Fix harmless compiler warnings in the shell.
FossilOrigin-Name: 9e2c17c5358b156b588542dbba38da7fedf5302b
2013-05-24 11:57:50 +00:00
drh
1ba00291a3 In the command-line shell, output the elements of the schema in the order
that they appear in the sqlite_master table.  This is necessary in some
cases to make the schema parsable.

FossilOrigin-Name: e5b3cd747bb0b484e38b8611a81925e2cc144435
2013-05-06 21:01:06 +00:00
drh
151b7d5bad In the command-line shell, make sure the output of dot-commands goes to
the same redirected output stream as the result of queries.
Ticket [2f96536e7ff7dba]

FossilOrigin-Name: b72d365920dbe45e61d8b1cff708a8858c2b3e33
2013-05-06 20:28:54 +00:00
drh
b7045ab2ed Move the test_spellfix.c module to ext/misc/spellfix.c.
FossilOrigin-Name: de556add10150140981a2e34b3712e96a7c262e3
2013-04-25 14:59:01 +00:00
drh
7a411f441b In the command-line shell, allow a dot-command to occur after a
multi-line c-style comment.

FossilOrigin-Name: e2c94ab930f0e5a6dbe8cdd34ebb8cfeeedca56c
2013-04-17 17:33:17 +00:00
drh
99b390827b Update the command-line shell to give an exit code of 0 when the ".quit"
command is run from the command-line.

FossilOrigin-Name: 467e218120d63d0f34c447f7324bac1364ac0eac
2013-04-17 12:19:48 +00:00
drh
9b4c59fa1b Refactoring the mmap interface. The controlling pragma is now "mmap_size"
instead of "mmap_limit".  Also change SQLITE_CONFIG_MMAP_LIMIT and
SQLITE_FCNTL_MMAP_LIMIT to SQLITE_CONFIG_MMAP_SIZE and
SQLITE_FCNTL_MMAP_SIZE, respecctively.  
The default mmap_size is now always 0, meaning that
memory mapped I/O is off by default.  There is a new compile-time option
SQLITE_MAX_MMAP_SIZE that determines a hard upper bound on the mmap_size.
Setting SQLITE_MAX_MMAP_SIZE to zero disables the memory-mapped I/O logic
and causes it to be omitted from the build.  An extra argument is added
to SQLITE_CONFIG_MMAP_SIZE that can optionally lower the SQLITE_MAX_MMAP_SIZE
at start-time. The SQLITE_MAX_MMAP_SIZE is zero for platforms where we 
know that it does not work, meaning that it cannot be turned on by mistake
on those platforms.

FossilOrigin-Name: ea1404a10abd7f68e1f8e0708c8a3199d1f79665
2013-04-15 17:03:42 +00:00
drh
7d9f3943ba Add the -mmap option to the command-line shell, for setting the default
mmap_limit.

FossilOrigin-Name: fc30d06c94c8212abb0477fb4cec4520d05bea34
2013-04-03 01:26:54 +00:00
drh
d5d0f6432c On Minix, disable the ".timer" command in the shell in order to avoid
calling getrusage().

FossilOrigin-Name: 9bd9bd9cab8c804c1a51d472199459176044a633
2013-02-20 00:54:21 +00:00
drh
173ba0998c Cause the command-line shell to issue an error message if you give something
that does not look like a boolean value to a dot-command that wants a boolean
argument.

FossilOrigin-Name: b4d94947fc11bd63180cbc27554b3bbb60abe7ff
2013-01-28 18:18:26 +00:00
drh
ef4c035275 Fix the test_spellfix.c extension so that it can be made loadable at run-time.
Add spellfix to the shell when building using the build-shell.sh script.

FossilOrigin-Name: 7813b17d8b9fe48ddc841fe1c4bb75f7747073de
2013-01-25 19:11:31 +00:00
drh
d3ac7d9b51 Enhance the command-line shell so that adding a non-zero numeric argument
to the ".exit" command causes an immediate exit without cleaning up.  This
can be used (for example) to cause journal files to be left behind.

FossilOrigin-Name: 8ba951d1b76a0fb0ffd9bc6cec1be3ddba80538a
2013-01-25 18:33:43 +00:00
drh
bc46f02c5d Improved parsing of the arguments to the ".backup" command in the
command-line shell.

FossilOrigin-Name: f1127e87b90c7ba049404ec68cb4e99009c22185
2013-01-23 18:53:23 +00:00
drh
25846af3be More test cases for the REGEXP operator. Fix minor bugs uncovered by these
test cases.

FossilOrigin-Name: a611c75061c8e821cb266fcb09759100d4a646b0
2012-12-31 20:16:35 +00:00
drh
14172743a2 Add the test_regexp.c module containing a cross-platform implementation
of the REGEXP operator.

FossilOrigin-Name: 46c8c01b751c1ea7fc02cc35e3b5bb99dbe46c4b
2012-12-31 19:18:38 +00:00
mistachkin
585dcb251b Improvements to the 'tcl' shell output mode. Escape double quotes, set separator to space when mode is set, and skip separator after final column.
FossilOrigin-Name: 41fd9dd29034b2269e4b7f2626350124d37b5303
2012-12-04 00:23:43 +00:00
drh
4d15a0d6d5 Do not exist the command-line shell if a ".read" command invokes a script that
contains two errors.  But reported on the mailing list.

FossilOrigin-Name: 2e5e65152758bc37439584ccba4c1b1c5ceb24f8
2012-12-01 20:21:22 +00:00
mistachkin
6d81d75d86 Fix typo in usage text for the command-line shell. Also, in the same usage text, make the file name argument to -init uppercase for consistency.
FossilOrigin-Name: a6d906cfeb9b181fd5b88df3650bab7ee1a24c0b
2012-10-25 15:43:28 +00:00
drh
98d312fc3e Improvements to the command-line argument parsing in the
command-line shell.  Command-line options can now occur either before
or after the database name and first command and are still accepted and
processed.  Command-line options are processed even if no database name
is given (and :memory: is assumed).

FossilOrigin-Name: 317c80cba3688a97ade9cde622cc3bd94cf3436a
2012-10-25 15:23:14 +00:00
drh
cef4fc89c4 Enable query planner tracing using the new (and undocumented) ".wheretrace 1"
command in the command-line shell if both the shell and the core are
compiled with SQLITE_DEBUG and SQLITE_ENABLE_WHERETRACE.  This is not a 
supported API. Use for testing and debugging only.

FossilOrigin-Name: 1be4b16b9e900181ae6848f2920ea646f407c9dc
2012-09-21 22:50:45 +00:00
drh
078b1fda34 Command-line shell enhancements: Added the ".print" command. Enhanced
the ".width" command so that negative widths will right-justify.

FossilOrigin-Name: a1d8269da3868e41a6603c1a683e324fe21fb317
2012-09-21 13:40:02 +00:00
drh
67ceaa6b9b Add to #undef statements to the command-line shell, go make sure that the
macros definitions that follow do not collide with system definitions.

FossilOrigin-Name: 24420d6d2077d745cc26dd269e76b48c8a3eeb3c
2012-08-27 21:19:03 +00:00
drh
2f3de3232c Another changes to the shell in support of SQLITE_OMIT_AUTOINIT.
FossilOrigin-Name: 3b4f5add04259eec145066312bcd532182cc339c
2012-06-27 16:41:31 +00:00
drh
bbb0be8688 Update the shell so that it works with SQLITE_OMIT_FLOATING_POINT and
SQLITE_OMIT_AUTOINIT.

FossilOrigin-Name: 95c0c995fd18c2de907a39fc52299c8abe502b68
2012-06-27 16:12:27 +00:00
mistachkin
fe7b2bc9ff Merge several compiler compatibility fixes to trunk.
FossilOrigin-Name: d3d491a5461e21d84c6425977b80deedc7fa8a3a
2012-06-21 14:05:15 +00:00
drh
83905c905c Remove support for OS/2 from the source tree.
FossilOrigin-Name: ff828c67e5d3c1afa5bc3a304b9c6fcc7b3ea5fa
2012-06-21 13:00:37 +00:00
mistachkin
c8bde37d19 Fix a few compilation issues that can occur with certain compilers (e.g. GCC 2.95.3, MSVC).
FossilOrigin-Name: f970a3de61fe2ebaf1778c4a3383cfdc52299162
2012-06-18 08:00:56 +00:00
drh
ac43e98d61 Change the ".schema" command of the shell to output VIEWs in declared order,
rather than alphabetical order, so that nested views will appear in the 
correct order.  Fix for ticket [cfe84e86839e59e8].

FossilOrigin-Name: e092ff69e25363f97495adc622f4250041ca9708
2012-05-21 03:15:06 +00:00
drh
b202d70a87 Fix a sign-extension problem for BLOB output in ".insert" mode of the
command-line shell.

FossilOrigin-Name: 282f2a74c23aa3fca6087bdeaf5d961b4f5bbe47
2012-04-24 12:12:57 +00:00
drh
9878123752 Update the ".table" command in the shell to show all tables in all
attached databases, and to avoid using the deprecated sqlite3_get_table()
function.

FossilOrigin-Name: ce2d06e2533763a8008e7a405630293d8f9a3108
2012-04-23 12:38:05 +00:00
drh
9b8d3572a9 If terminating interactive input to the command-line shell with ^D, issue
an extra \n to move the cursor to the next line before exiting.

FossilOrigin-Name: feff1ef0b8f7b51ae80a9d34380b46a5103bf6cd
2012-04-21 11:33:39 +00:00
drh
d8621b90c9 Add an undocumented and possibly ephemeral ".breakpoint" command to the
command-line shell, to call a no-op routine on which it is convenient to 
set a symbolic debugger breakpoint.

FossilOrigin-Name: 8e2363ad76446e863d03ead91fd621e59d5cb495
2012-04-17 09:09:33 +00:00
drh
8c5058bbdb Fix a bug in the command-line shell logic that attempts to continue with a
".dump" even after encountering database corruption.

FossilOrigin-Name: 020b5e90f950a42299074ff770612b9e68850d95
2012-04-16 17:22:30 +00:00
drh
85e7243acf Fix harmless static-analysis warnings, mosting having to do with memory
leaks in the command-line shell.  Add a clang analysis of the command-line
shell to the "warnings-clang.sh" script.  Other minor cleanups to the
command-line shell code.

FossilOrigin-Name: 93a0f452a7023898ad3d62ee81b39a80477c332f
2012-04-11 11:38:53 +00:00
drh
42f64e52ee Add the ".trace" option to the command-line shell.
FossilOrigin-Name: b9ac3d7e340eb616fd23cc7dbdef6fdd66a79fe4
2012-04-04 16:56:23 +00:00
drh
e1da8fadcc In the ".output" command-line shell, if the first character of the output
filename is '|' then use popen() instead of fopen().

FossilOrigin-Name: fa82062c659ffbe7ad01106d3ef54d7bb44f1f44
2012-03-30 00:05:57 +00:00
drh
fbbcd5deda Add SQLITE_DBSTATUS_CACHE_WRITE to the command-line shell.
FossilOrigin-Name: 30b8dd326d28c0c08543989e376011ea41773a7e
2012-03-24 20:09:33 +00:00
drh
bf92ec0ce3 Always quote the names of tables in the output of the shell's ".dump" command,
even if the name is pure alphabetic text, in case the name is a keyword.

FossilOrigin-Name: 638b71150281a211f89b4057b0d5d32d3fbcf323
2012-03-22 12:50:34 +00:00
drh
cc3b4f8c55 Command-line shell enhancements: Reorganize the "usage" comment so that
options are in alphabetical order.  Add the new "--cmd" option.  Allow
either "--option" or "-option" for options.

FossilOrigin-Name: 9497893b1b9219eac4ec2183bd90b4e4b860d9fe
2012-02-07 14:13:50 +00:00
drh
b21a8e4834 Update the .dump command of the command-line shell so that it (1) avoids
putting the semicolon of a DDL statement on the same line as a comment,
(2) avoids long expression, even when dumping a table with many columns, and
(3) avoids unnecessary quoting of the table name.  This fixes tickets
[c04a8b8a4f] and [232637c465].  
Shell change only; no changes to the SQLite core.

FossilOrigin-Name: e6eea8d50d6c307e3e34891758ed4912d368580b
2012-01-28 21:08:51 +00:00