Commit Graph

52 Commits

Author SHA1 Message Date
drh a9e1e4edaf Small performance increase in the symbol hash table.
FossilOrigin-Name: a19597b4fd2530a89363992b9179f9f3f0621a6e3861a91324f29311aafe09b9
2023-01-03 19:27:00 +00:00
drh f6ad201ac2 Fixes for harmless compiler warnings.
FossilOrigin-Name: c28c973ad6debd63f13e5d4d3da036f680baaec9d863eda039f2747db9f1cfd5
2019-04-13 14:07:57 +00:00
drh 19efd0db41 Simplifications to the sqlite3_normalized_sql() implementation.
FossilOrigin-Name: 94ea6379178e3ff6a0d1d5819ca4ac558bdadb1ca8a3637c797079db7dc0cd61
2018-12-05 17:48:57 +00:00
drh 707821ff72 Enhance the sqlite3_normalize_sql() interface so that it works even if the
prepared statement was not initially compiled using
SQLITE_PREPARE_NORMALIZED.  Enhance the ".trace" command in the CLI so that
it is able to access the full scope of functionality provided by 
sqlite3_trace_v2() and in particular so that it is able to show normalized
SQL output using the newly enhanced sqlite3_normalize_sql() interface.

FossilOrigin-Name: 7da617e97eb905cb009c47403786682b911e32a630f266e1c53ea72836fc88b5
2018-12-05 13:39:06 +00:00
mistachkin 8bee11a41e Add the sqlite3_normalized_sql() API.
FossilOrigin-Name: 592b66e8058dd03a056a036e2606247c9efdb06d15eebe9bcc455f7f55e30ae6
2018-10-29 17:53:23 +00:00
drh a35d851892 Make the hash table implementation a little smaller and faster.
FossilOrigin-Name: f762f1effe1ce893d6b67815ad8b585bae2c1621d9199dac9c85d39dad16e774
2017-07-05 23:33:33 +00:00
drh 5f33eaa6a4 Use Knuth multiplicative hashing for the symbol table.
FossilOrigin-Name: cc29ddd6be60bdbf107f285c9eb57d5896ebca2d
2016-09-28 20:42:31 +00:00
drh 75ab50ce8f Use comments to mark several branches as optimizations. No changes to code.
FossilOrigin-Name: 33e627472780b872716c504f2d585cc057c390a5
2016-04-28 14:15:12 +00:00
drh acbcb7e013 Simplify the interface to the symbol table, saving 600 bytes of code space.
FossilOrigin-Name: 14b0f561fe15622b61c6676c9c455dca6b9ba5f0
2014-08-21 20:26:37 +00:00
drh dc3bb0deb2 Use an unsigned integer to accumulate the string hash. Avoids compiler
warnings.

FossilOrigin-Name: b1824344ea4918a13abbda4a3b7134d35fd867c4
2014-01-24 16:36:18 +00:00
mistachkin 5f070c7bc8 More warning fixes.
FossilOrigin-Name: 51a6a797e1d61c4361b87cdf3467bfd3ce161cc3
2012-10-18 10:35:19 +00:00
dan 38d073040d Fix a bug in hash.c introduced by [305b66672653].
FossilOrigin-Name: 17cb5e951e419b1221ae4595d20059d90a361a39
2012-08-07 15:19:27 +00:00
dan 6809c96df3 Replace a few sqlite3_malloc()+memset() sequences with calls to sqlite3MallocZero().
FossilOrigin-Name: 305b6667265353b858b79bfea1745e64ff3bb7d3
2012-07-30 14:53:54 +00:00
drh c81c11f62c Remove the obsolete "$Id:$" RCS identifier strings from the source code.
FossilOrigin-Name: f6c045f649036958078cb15cd9d5453680c82b0c
2009-11-10 01:30:52 +00:00
drh 782b873bf5 Convert an always-true condition in hash.c into an assert(). (CVS 6624)
FossilOrigin-Name: 4237299935b8bf8c346aacba021113224813bcb9
2009-05-09 23:29:12 +00:00
drh e61922a6a1 Remove the aFKey hash table, which was not being used. Simplify the
FKey object.  Simplify the hash.c module since the copyKey parameter
formerly used only by aFKey is now no longer required. (CVS 6594)

FossilOrigin-Name: 80c43a355c6e482457abc2f9c3ad3a565cec55fb
2009-05-02 13:29:37 +00:00
drh 0d59d17c41 Fix asserts in hash.c so that zero-length symbols can be used. (CVS 6563)
FossilOrigin-Name: fe9f00aa369051beee09ab3d1a2e046a1f679a40
2009-04-28 17:33:16 +00:00
drh 8a1e594c9f Simplifications to the symbol table implementation in hash.c. For very small
symbol tables (less than 10 entries) a simple linked list is used instead
of a hash table.  Number of hash table buckets is limited to prevent large
allocations. (CVS 6559)

FossilOrigin-Name: 5c737835dec9e6038b304c198aa14337a6f23c1c
2009-04-28 15:43:45 +00:00
drh a83ccca794 Do not store the zero string terminator as part of the name when holding
symbols in the symbol table. (CVS 6557)

FossilOrigin-Name: 23d67af39227aeade2ea0292e1b8844eea580993
2009-04-28 13:01:09 +00:00
drh e2f02bacc1 Increased test coverage. (CVS 6147)
FossilOrigin-Name: 45bb5703d7ef5e835b43a6fa7ee2a2d96db76939
2009-01-09 01:12:27 +00:00
drh ea6788322e Never use strlen(). Use our own internal sqlite3Strlen30() which is
guaranteed to never overflow an integer.  Additional explicit casts to
avoid nuisance warning messages. (CVS 6007)

FossilOrigin-Name: c872d554930ecf221ac2be5f886d5d67bb35288c
2008-12-10 19:26:22 +00:00
drh 1b67f3caf2 Simplify the symbol hash table to use only a single key class. Other
changes to improve code coverage. (CVS 5794)

FossilOrigin-Name: ff50a8a7e5a15fac192939ff3206fa18d1c5a6dd
2008-10-10 17:41:28 +00:00
danielk1977 2d1d86fbbe Add a mode to the sqlite3_test_control() interface to register hooks called at the beginning and end of "benign malloc failure" blocks. This allows malloc() failure testing to be done using public APIs only. (CVS 5254)
FossilOrigin-Name: 56c8af1452dfdc8da858a2411bd6f3663a8a9326
2008-06-20 14:59:51 +00:00
drh e5ae5735c0 Continuing work on the new memory allocation subsystem.
Added routines for temporary memory allocation.  Right the btree
balance mechanism to only do one temporary allocation at a time. (CVS 5220)

FossilOrigin-Name: 65fe7b62cfe7d11cd667681a64c96fe7b2fe5685
2008-06-15 02:51:47 +00:00
drh 4873d5f614 Make the benign-fault setting recursive. Make all malloc failures
during a rollback benign since there is nothing we can do about them. (CVS 5128)

FossilOrigin-Name: a9d1d931358637a6f039723a053098f65530de4b
2008-05-13 13:27:33 +00:00
drh 41eb9e9986 Minor optimizations. (CVS 4955)
FossilOrigin-Name: e8529455803e0dab167f4faba5846fa1eafef741
2008-04-02 18:33:07 +00:00
drh eee4c8ca11 Add the memory fault simulator to mem5.c. Enable soft heap limit on mem5.c.
Limit the size of hash tables and the vdbefifo when using mem5.c. (CVS 4795)

FossilOrigin-Name: 63da5d97542e4f54c33329833477c8d96ce05dd0
2008-02-18 22:24:57 +00:00
drh 643167ff21 Add the fault injector module in fault.c. Use it as a basis for memory
allocation failure testing. (CVS 4742)

FossilOrigin-Name: 1a335e180183b414fcc3510ce28b98b21cd134a6
2008-01-22 21:30:53 +00:00
danielk1977 7c836f06d3 Add internal locking to the test_async.c backend. So that more than one connection may be used from within a single process. (CVS 4396)
FossilOrigin-Name: 17ca684c124445f17d1e36c37e169056c5fd4569
2007-09-04 14:31:47 +00:00
danielk1977 cd2543b6ae Fix a problem in hash.c when replacing entries in tables configured with copyKey==0. (CVS 4375)
FossilOrigin-Name: a19d3a73a91f2040ec35d913f11743ff4913ffb7
2007-09-03 15:03:20 +00:00
danielk1977 a1644fd863 Modifications to the malloc failure tests to test transient and persistent failures. (CVS 4321)
FossilOrigin-Name: e38ef81b85feb5bff2ad8448f3438ff0ab36571e
2007-08-29 12:31:25 +00:00
danielk1977 1e5369531e More work on refactoring of malloc() interfaces. There are still many errors. (CVS 4233)
FossilOrigin-Name: 77b1671351fe94b0ebc126a63140643deae2aa64
2007-08-16 10:09:01 +00:00
drh 174357527a Half-way through a major refactoring of the memory allocation.
I have not even attempted to compile so I am certain there are
countless errors. (CVS 4231)

FossilOrigin-Name: deb7ecd65f7b83eaf0ba610eeef3b0ede61db1c3
2007-08-16 04:30:38 +00:00
drh 93553ad05b Fix a long-standing memory leak in the hash table. The leak only appears
following a malloc failure of a hash that copies its keys, which rarely
happens and so we have not previously noticed it. (CVS 3777)

FossilOrigin-Name: 2aae1964572f4d4d1eae090a997e0bd9a82a69b2
2007-03-31 03:59:23 +00:00
danielk1977 750b03e543 Changes so that test_async.c works with memory management turned on. (CVS 3093)
FossilOrigin-Name: f4150c29df2774b4422d4296d913cdbcee62c859
2006-02-14 10:48:39 +00:00
drh 762e584e2c The hash tables deallocate when empty in order to avoid nuisanse complaints
from valgrind.  Added tests to verify no hash table memory leaks in os_unix.c. (CVS 2738)

FossilOrigin-Name: 080eadca582a49a069a76ed113ec15e9bce2955a
2005-10-03 15:11:08 +00:00
danielk1977 52a83fbbe9 Move sqlite3HashNoCase to hash.c. (CVS 2294)
FossilOrigin-Name: 5c10ccd8e99cab7e9f8e733dfd1447c2df1d25c1
2005-01-31 12:56:44 +00:00
drh e8cf2cacb1 Optimizations in the hash table module. (CVS 1896)
FossilOrigin-Name: d5b0269e0dd7c310460a7ffc4120ed45db823ce9
2004-08-20 14:08:50 +00:00
drh 76d7f8b385 Do not use "new" as a variable name - some compilers think it is a keyword. (CVS 1787)
FossilOrigin-Name: 8a6e4ea79e5f4333fbc767832d5e55c77da204e1
2004-06-30 22:43:21 +00:00
drh cc19587998 Improved test coverage of func.c and hash.c. (CVS 1772)
FossilOrigin-Name: 0c999f28137bd82ba24dd263bab30d22329eed73
2004-06-30 03:08:24 +00:00
danielk1977 4adee20fcb Change lots of internal symbols from sqliteXXX to sqlite3XXX so that the
library links again. It doesn't work yet, due to changes in the btree layer
calling convention. (CVS 1324)

FossilOrigin-Name: 8af6474c49263ae26216dff9465b33f76b500cf4
2004-05-08 08:23:19 +00:00
drh ba21256f98 Remove unused code and tighten existing code to make the library a little
smaller. (CVS 1168)

FossilOrigin-Name: 34a6b7416c6c9bcdf301f5e7b072a0362a746105
2004-01-08 02:17:31 +00:00
drh 5364f60302 Make sure hash functions always return non-negative. (CVS 969)
FossilOrigin-Name: 39a3e403f0440acb2f85a064ec23d404f9cdfbc4
2003-05-12 23:06:52 +00:00
drh 8c1238aebd Code optimizations to help the library run faster. (CVS 808)
FossilOrigin-Name: db745e87dc26cf1a35cdcec18f4b659742e14120
2003-01-02 14:43:55 +00:00
drh 2ce1a6ec60 Fix for ticket #47: Use a cast to avoid a warning about discarding a "const"
inside of hash.c. (CVS 577)

FossilOrigin-Name: 0c903461533fabca7815e8cccbd3b712bcd22ddc
2002-05-21 23:44:30 +00:00
drh 8e0a2f903a Added support for user-defined normal functions. Support for user-defined
aggregates is pending. (CVS 390)

FossilOrigin-Name: c490a1ff951c5d4a2de8e4f8d349189bfaef7f74
2002-02-23 23:45:45 +00:00
drh 1ab4300ebc Fix warning messages in VC++. Patches from nicolas352001. (CVS 347)
FossilOrigin-Name: f3038d218c91b44b70b75a7b881ea24c87fa6a02
2002-01-14 09:28:19 +00:00
drh aacc543e23 Comment updates most. Also some small changes to the VDBE. (CVS 339)
FossilOrigin-Name: 9b0be4fcc1cbca69f5fee906f86dfb36a323fe84
2002-01-06 17:07:40 +00:00
drh 5a2c2c20af Attempting to add support for 64-bit platforms. (CVS 314)
FossilOrigin-Name: 03673adbfe0c8a92d79f86ddf1136736594208ad
2001-11-21 02:21:11 +00:00
drh 6d4abfbee5 More changes for 2.0.7. (CVS 293)
FossilOrigin-Name: f8328a5f11801c5124f9a8dace22df3c1cfb2191
2001-10-22 02:58:08 +00:00