]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agoReleased v2.2.33.2. release-2.2.33 2.2.33.2
Timo Sirainen [Fri, 20 Oct 2017 13:34:22 +0000 (16:34 +0300)] 
Released v2.2.33.2.

7 years agoauth: Fix %{ldap_dn} not to leak memory
Timo Sirainen [Thu, 19 Oct 2017 12:39:28 +0000 (15:39 +0300)] 
auth: Fix %{ldap_dn} not to leak memory

7 years agocassandra: Support "timestamp" type fields properly
Timo Sirainen [Mon, 16 Oct 2017 12:41:56 +0000 (15:41 +0300)] 
cassandra: Support "timestamp" type fields properly

Fixes setting them with prepared statements. Reading them never worked
earlier.

7 years agocassandra: Include "prepared" when logging about prepared statement queries
Timo Sirainen [Mon, 16 Oct 2017 12:12:12 +0000 (15:12 +0300)] 
cassandra: Include "prepared" when logging about prepared statement queries

Mainly useful for debugging/testing.

7 years agocassandra: Fix using bigint types with unprepared statements
Timo Sirainen [Mon, 16 Oct 2017 11:49:56 +0000 (14:49 +0300)] 
cassandra: Fix using bigint types with unprepared statements

This reverts the code to not using the statements with binding at all.
Alternative fix would be to start using explicit int32 or int64 parameter
types, but that breaks backwards compatibility a bit.

7 years agodoveadm proxy: Don't crash if remote doesn't support log proxying
Timo Sirainen [Sat, 14 Oct 2017 09:54:18 +0000 (12:54 +0300)] 
doveadm proxy: Don't crash if remote doesn't support log proxying

7 years agoReleased v2.2.33.1. 2.2.33.1
Timo Sirainen [Wed, 11 Oct 2017 16:43:04 +0000 (19:43 +0300)] 
Released v2.2.33.1.

7 years agolib-master: Allow a second log initialization after settings have been read.
Timo Sirainen [Wed, 11 Oct 2017 10:03:51 +0000 (13:03 +0300)] 
lib-master: Allow a second log initialization after settings have been read.

This fixes logging with services that bypass the log service (lda or -L
parameter).

7 years agoReleased v2.2.33. 2.2.33
Timo Sirainen [Tue, 10 Oct 2017 15:20:31 +0000 (18:20 +0300)] 
Released v2.2.33.

7 years agolib: ostream-multiplex - ignore flush return value
Timo Sirainen [Tue, 10 Oct 2017 12:38:13 +0000 (15:38 +0300)] 
lib: ostream-multiplex - ignore flush return value

There's nothing that can be done about it at close() time. Silences static
analyzer warnings.

7 years agolib: ostream-multiplex - remove unnecessary flushes
Timo Sirainen [Tue, 10 Oct 2017 12:37:39 +0000 (15:37 +0300)] 
lib: ostream-multiplex - remove unnecessary flushes

7 years agodoveadm-mail-crypt: Do not return prematurely in key generate
Aki Tuomi [Tue, 10 Oct 2017 09:52:15 +0000 (12:52 +0300)] 
doveadm-mail-crypt: Do not return prematurely in key generate

Broken by 446d7d9ddfe122e152b832c13fc28d164ae2c5e9

7 years agolib: istream-multiplex - Minor optimization
Timo Sirainen [Tue, 10 Oct 2017 09:33:08 +0000 (12:33 +0300)] 
lib: istream-multiplex - Minor optimization

There's no need to find channel when we already know it. This also helps
static analyzers to understand that req_channel can't be NULL.

7 years agoostream-multiplex: Check flush return value
Aki Tuomi [Fri, 6 Oct 2017 06:02:49 +0000 (09:02 +0300)] 
ostream-multiplex: Check flush return value

7 years agotest-ostream-escaped: Check flush return value
Aki Tuomi [Fri, 6 Oct 2017 05:55:33 +0000 (08:55 +0300)] 
test-ostream-escaped: Check flush return value

Found by coverity

7 years agodoveadm-server: Remove flush before multiplex
Aki Tuomi [Fri, 6 Oct 2017 05:54:38 +0000 (08:54 +0300)] 
doveadm-server: Remove flush before multiplex

It's not really necessary, found by coverity

7 years agoiostream-multiplex: Check return values in tests
Aki Tuomi [Fri, 6 Oct 2017 05:52:18 +0000 (08:52 +0300)] 
iostream-multiplex: Check return values in tests

7 years agodoveadm: Return after destroying connection
Aki Tuomi [Fri, 6 Oct 2017 05:46:00 +0000 (08:46 +0300)] 
doveadm: Return after destroying connection

Prevents NULL deferences, found by coverity.

7 years agodoveadm mcp keypair generate: Fix -f parameter
Timo Sirainen [Thu, 17 Aug 2017 11:17:46 +0000 (14:17 +0300)] 
doveadm mcp keypair generate: Fix -f parameter

7 years agopop3: Expand settings to fix rawlog_dir
Timo Sirainen [Fri, 6 Oct 2017 11:39:00 +0000 (14:39 +0300)] 
pop3: Expand settings to fix rawlog_dir

Even if %variables weren't used in rawlog_dir, the path was always prefixed
with "0".

7 years agodoveadm-mail-crypt: Print existing folder key hash when aborting generate
Martti Rannanjärvi [Fri, 6 Oct 2017 09:47:06 +0000 (12:47 +0300)] 
doveadm-mail-crypt: Print existing folder key hash when aborting generate

7 years agodoveadm-mail-crypt: Print existing userkey hash when aborting generate
Martti Rannanjärvi [Fri, 6 Oct 2017 08:07:23 +0000 (11:07 +0300)] 
doveadm-mail-crypt: Print existing userkey hash when aborting generate

7 years agomail-crypt: Improve doveadm output
Aki Tuomi [Thu, 5 Oct 2017 12:53:16 +0000 (15:53 +0300)] 
mail-crypt: Improve doveadm output

7 years agomail-crypt: Fix key generation handling
Aki Tuomi [Thu, 5 Oct 2017 12:40:45 +0000 (15:40 +0300)] 
mail-crypt: Fix key generation handling

Userkey generation would not set all required fields.

7 years agoostream-multiplex: Unreference stream parent
Aki Tuomi [Mon, 9 Oct 2017 15:21:24 +0000 (18:21 +0300)] 
ostream-multiplex: Unreference stream parent

Otherwise it won't get free'd.

7 years agodoveadm: Add remote(host) prefix to all proxied logs
Timo Sirainen [Mon, 9 Oct 2017 10:55:06 +0000 (13:55 +0300)] 
doveadm: Add remote(host) prefix to all proxied logs

7 years agodoveadm log test: Fix it to work again
Timo Sirainen [Mon, 9 Oct 2017 11:28:17 +0000 (14:28 +0300)] 
doveadm log test: Fix it to work again

Broken by 719abeb2088987f213a33a7dd1fe78958beaef03

7 years agolib: ostream-multiplex - set ostream_private.parent
Timo Sirainen [Mon, 9 Oct 2017 10:19:32 +0000 (13:19 +0300)] 
lib: ostream-multiplex - set ostream_private.parent

Unlike with istream-multiplex, there are no issues with I/Os. Only the
parent stream will have the I/O. Using the default parent adds the
missing methods that otherwise would have needed to be implemented:
 - cork
 - flush_pending
 - switch_ioloop

7 years agolib: istream-multiplex - Forward i_stream_switch_ioloop() to parent
Timo Sirainen [Mon, 9 Oct 2017 10:14:23 +0000 (13:14 +0300)] 
lib: istream-multiplex - Forward i_stream_switch_ioloop() to parent

Most istreams do this because istream_private.parent is set to the parent
stream, but this can't be done with istream-multiplex. The main problem
with attempting to do the same with istream-multiplex is that the different
channels don't share the same I/O. Just because one channel received data
doesn't mean that other channels received any data. (It would be possible
to solve this by implementing a new method that allows overriding
i_stream_set_io(), but I'm not sure if that's a good idea either.)

7 years agoacl: Fix compiler warning with -Wstrict-bool
Timo Sirainen [Sun, 8 Oct 2017 22:22:47 +0000 (01:22 +0300)] 
acl: Fix compiler warning with -Wstrict-bool

7 years agoacl: Fix checking create (k) permission in global acl-file
Timo Sirainen [Fri, 6 Oct 2017 13:55:28 +0000 (16:55 +0300)] 
acl: Fix checking create (k) permission in global acl-file

Just because the global ACL file hasn't changed since it was last refreshed
for another ACL object, it doesn't mean that those ACLs don't need to be
applied to this ACL object.

This didn't usually cause problems, because the initial ACL object refresh
was always done due to local-path refresh returning "needs a refresh".
The only exception was when acl_object_init_from_parent() was called,
because it added an empty non-NULL validity for the local-path, so the
"needs a refresh" wasn't returned. This happened only when trying to
CREATE or RENAME mailbox under a parent where user didn't have create
permissions.

This affected only when using a single global acl-file, not when using
global acl directory containing per-mailbox files.

7 years agoacl: Cleanup - move code to a new acl_vfile_validity_has_changed()
Timo Sirainen [Fri, 6 Oct 2017 13:54:20 +0000 (16:54 +0300)] 
acl: Cleanup - move code to a new acl_vfile_validity_has_changed()

7 years agoacl: Fix checking whether global acl-file has changed
Timo Sirainen [Fri, 6 Oct 2017 13:44:01 +0000 (16:44 +0300)] 
acl: Fix checking whether global acl-file has changed

We always assumed that it was changed and re-read it.

7 years agoauth: Fix %{ldap_dn} change to compile with v2.2 API
Timo Sirainen [Fri, 6 Oct 2017 13:30:11 +0000 (16:30 +0300)] 
auth: Fix %{ldap_dn} change to compile with v2.2 API

7 years agoauth: Expand %{ldap_dn} to ldap_get_dn().
Sergey Kitov [Fri, 15 Sep 2017 12:17:08 +0000 (15:17 +0300)] 
auth: Expand %{ldap_dn} to ldap_get_dn().

7 years agolib: iostream-multiplex tests - Fix hangs by setting the pipe fds non-blocking
Timo Sirainen [Thu, 5 Oct 2017 17:25:29 +0000 (20:25 +0300)] 
lib: iostream-multiplex tests - Fix hangs by setting the pipe fds non-blocking

7 years agolib: istream-multiplex - Minor code cleanup
Timo Sirainen [Thu, 5 Oct 2017 17:24:11 +0000 (20:24 +0300)] 
lib: istream-multiplex - Minor code cleanup

Avoid propagating the error twice, and avoid any confusion about what "got"
actually contains.

7 years agoReleased v2.2.33.rc1. 2.2.33.rc1
Timo Sirainen [Thu, 5 Oct 2017 17:07:11 +0000 (20:07 +0300)] 
Released v2.2.33.rc1.

7 years agodirector: When ring is synced, purge any pending "removed" directors
Timo Sirainen [Thu, 5 Oct 2017 09:34:10 +0000 (12:34 +0300)] 
director: When ring is synced, purge any pending "removed" directors

This allows adding a director back to the ring without having to wait for 30
seconds.

7 years agodirector: Rename director_delayed_dir_remove_timeout() to director_hosts_purge_removed()
Timo Sirainen [Tue, 3 Oct 2017 13:40:32 +0000 (16:40 +0300)] 
director: Rename director_delayed_dir_remove_timeout() to director_hosts_purge_removed()

This allows using it for other purposes without having a confusing name.

7 years agodirector: Fix potential panic when director is alone
Timo Sirainen [Thu, 5 Oct 2017 13:12:38 +0000 (16:12 +0300)] 
director: Fix potential panic when director is alone

If director is alone and it can't connect to other directors, it might crash
with:

Panic: file director.c: line 318 (director_set_ring_synced): assertion failed: (!dir->ring_synced)

7 years agodirector: Allow doveadm director ring remove for the same director
Timo Sirainen [Thu, 5 Oct 2017 08:51:23 +0000 (11:51 +0300)] 
director: Allow doveadm director ring remove for the same director

Fixes:
Panic: file doveadm-connection.c: line 859 (doveadm_connection_cmd_run): assertion failed: (conn->dir->right == NULL && conn->dir->left == NULL)

7 years agodirector: Don't crash on doveadm director ring remove for unknown director
Timo Sirainen [Thu, 5 Oct 2017 08:49:31 +0000 (11:49 +0300)] 
director: Don't crash on doveadm director ring remove for unknown director

Ring syncing isn't started, so it shouldn't try to wait for ring sync.

Fixes:
Panic: file doveadm-connection.c: line 859 (doveadm_connection_cmd_run): assertion failed: (conn->dir->right == NULL && conn->dir->left == NULL)

7 years agodirector: Don't crash if DIRECTOR-REMOVE is received for itself
Timo Sirainen [Thu, 5 Oct 2017 08:46:55 +0000 (11:46 +0300)] 
director: Don't crash if DIRECTOR-REMOVE is received for itself

This triggers the director removal from the ring, which causes the
connection to be destroyed. But since we're still in the middle of handling
the connection it needs refcounting.

7 years agodirector: Fix ring sync wait after DIRECTOR-REMOVE
Timo Sirainen [Thu, 14 Sep 2017 15:13:05 +0000 (18:13 +0300)] 
director: Fix ring sync wait after DIRECTOR-REMOVE

It was sending OK twice, and the first OK was too early.

7 years agodirector: Ignore CONNECT requests to hosts that have been removed already
Timo Sirainen [Thu, 14 Sep 2017 14:59:05 +0000 (17:59 +0300)] 
director: Ignore CONNECT requests to hosts that have been removed already

7 years agodirector: After CONNECT was received, make sure we disconnect
Timo Sirainen [Thu, 14 Sep 2017 14:57:29 +0000 (17:57 +0300)] 
director: After CONNECT was received, make sure we disconnect

The remote side won't be reading anything after the CONNECT, so we have to
disconnect anyway. If we decide that the CONNECT request is wrong, reconnect
after a short delay and hope that the remote agrees with us the next time.

7 years agodirector: When director is removed, notify it before disconnecting
Timo Sirainen [Thu, 14 Sep 2017 14:48:50 +0000 (17:48 +0300)] 
director: When director is removed, notify it before disconnecting

This way the removed director will know that it's been removed, and it
can also more quickly forward the removal to other directors.

7 years agodirector: Don't reset directors' last_network_failure while handshaking
Timo Sirainen [Thu, 14 Sep 2017 14:38:24 +0000 (17:38 +0300)] 
director: Don't reset directors' last_network_failure while handshaking

The reset is done mainly to make it faster for a director that has been down
to connect back to the ring, without other directors still thinking that
it's down. But DIRECTOR that is sent during handshake says nothing about
whether the director is up at the moment or not.

7 years agodirector: Log info line for every incoming/outgoing connection
Timo Sirainen [Thu, 14 Sep 2017 14:35:02 +0000 (17:35 +0300)] 
director: Log info line for every incoming/outgoing connection

This can help with debugging problems.

7 years agodirector: Cleanup - move code to a new director_log_connect()
Timo Sirainen [Thu, 14 Sep 2017 14:33:19 +0000 (17:33 +0300)] 
director: Cleanup - move code to a new director_log_connect()

Also adds a missing ')' to the log line.

7 years agodirector: Log info line whenever a director is added/removed from ring
Timo Sirainen [Thu, 14 Sep 2017 14:29:48 +0000 (17:29 +0300)] 
director: Log info line whenever a director is added/removed from ring

This can help with debugging problems.

7 years agodirector: Improve debugging: Log ring desync when there is no right connection
Timo Sirainen [Thu, 14 Sep 2017 15:13:33 +0000 (18:13 +0300)] 
director: Improve debugging: Log ring desync when there is no right connection

7 years agodirector: When logging "ring SYNC lost", include sync seq number in message
Timo Sirainen [Thu, 14 Sep 2017 14:26:39 +0000 (17:26 +0300)] 
director: When logging "ring SYNC lost", include sync seq number in message

This can help with debugging.

7 years agodoveadm director ring remove: Wait ring sync before and after removal
Timo Sirainen [Thu, 14 Sep 2017 08:57:27 +0000 (11:57 +0300)] 
doveadm director ring remove: Wait ring sync before and after removal

This helps mainly with automated tests.

7 years agolib-master: master_service_init_log() - Switch log handlers only on the first call
Timo Sirainen [Tue, 3 Oct 2017 11:51:16 +0000 (14:51 +0300)] 
lib-master: master_service_init_log() - Switch log handlers only on the first call

The secondary calls were only done by mail_storage_service_*() calls. They
want to initialize the logging once, but afterwards they only care about
changing the log prefix. Switch to this behavior now explicitly.

This fixes behavior if logging functions are changed between
mail_storage_service_*() calls, so they don't get reset.

7 years agolib: Fix warning with gcc7's -Wint-in-bool-context
Timo Sirainen [Thu, 5 Oct 2017 09:47:17 +0000 (12:47 +0300)] 
lib: Fix warning with gcc7's -Wint-in-bool-context

7 years agodoveadm: Deliver remote logs over doveadm socket
Aki Tuomi [Thu, 24 Aug 2017 11:59:07 +0000 (14:59 +0300)] 
doveadm: Deliver remote logs over doveadm socket

7 years agodoveadm: Refactor server/client code to support versioning properly
Aki Tuomi [Thu, 24 Aug 2017 11:45:22 +0000 (14:45 +0300)] 
doveadm: Refactor server/client code to support versioning properly

This way we can distinguish between old and new server side

7 years agodoveadm-server: Refactor connection handshake and authentication
Aki Tuomi [Tue, 12 Sep 2017 10:43:30 +0000 (13:43 +0300)] 
doveadm-server: Refactor connection handshake and authentication

Simplifies next change

7 years agolib: Add multiplex stream support
Aki Tuomi [Tue, 22 Aug 2017 07:14:22 +0000 (10:14 +0300)] 
lib: Add multiplex stream support

This allows having multiple channels of data in single stream.

7 years agodirector: Fix HOST-RESET-USERS when all hosts are down
Timo Sirainen [Wed, 4 Oct 2017 12:41:03 +0000 (15:41 +0300)] 
director: Fix HOST-RESET-USERS when all hosts are down

If there were a lot of users being kicked, the host was flushed after the
initial round of user kills. This caused the rest of the user connections to
be just discarded instead of actually being killed.

7 years agodirector: Fix tracking user move count when user is freed early
Timo Sirainen [Wed, 4 Oct 2017 12:39:08 +0000 (15:39 +0300)] 
director: Fix tracking user move count when user is freed early

users_moving_count wasn't updated if the user was freed before killing it
finished. This caused "doveadm director flush" to hang while waiting for
the move count to drop to 0, which it never did. Also following flushes
were doing less work in parallel, or possibly even nothing since director
thought there were too many users already being moved.

7 years agoquota-clone: Always update dict
Aki Tuomi [Wed, 4 Oct 2017 07:32:17 +0000 (10:32 +0300)] 
quota-clone: Always update dict

ret_count and ret_bytes become zero if no quota rules
are specified, so we need to update the dict anyways.

Broken in 81d10aff29baede9ae4944d6c89790871123d11d

7 years agodsync: Add hashed_headers setting
Aki Tuomi [Fri, 22 Sep 2017 10:30:43 +0000 (13:30 +0300)] 
dsync: Add hashed_headers setting

This makes it possible to configure them

7 years agodsync: Fix typo, it's ibc not icb
Aki Tuomi [Fri, 22 Sep 2017 11:08:45 +0000 (14:08 +0300)] 
dsync: Fix typo, it's ibc not icb

7 years agodsync: Add missing space to handshake optional keys
Aki Tuomi [Mon, 25 Sep 2017 07:28:03 +0000 (10:28 +0300)] 
dsync: Add missing space to handshake optional keys

7 years agodoveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:29 +0000 (11:02 +0300)] 
doveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

7 years agolmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:07 +0000 (11:02 +0300)] 
lmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

7 years agoauth: Avoid DNS lookup for "host" if passdb returns also "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:01:20 +0000 (11:01 +0300)] 
auth: Avoid DNS lookup for "host" if passdb returns also "hostip"

7 years agolib: Fix compiler warning in var-expand-if
Timo Sirainen [Tue, 25 Jul 2017 07:39:43 +0000 (10:39 +0300)] 
lib: Fix compiler warning in var-expand-if

7 years agolib: Fix static analyzer warnings in var-expand-if
Timo Sirainen [Tue, 25 Jul 2017 06:43:56 +0000 (09:43 +0300)] 
lib: Fix static analyzer warnings in var-expand-if

7 years agovar-expand-if: Remove unused variable par_start
Aki Tuomi [Mon, 24 Jul 2017 15:30:01 +0000 (18:30 +0300)] 
var-expand-if: Remove unused variable par_start

7 years agovar-expand: Add tests for var_expand conditionals
Aki Tuomi [Mon, 24 Jul 2017 10:31:49 +0000 (13:31 +0300)] 
var-expand: Add tests for var_expand conditionals

7 years agovar-expand: Add support for conditionals
Aki Tuomi [Mon, 24 Jul 2017 10:31:02 +0000 (13:31 +0300)] 
var-expand: Add support for conditionals

%{if;value-a,op,value-b:true-value:false-value}

7 years agodirector: Remember backends' hostnames and send them in login reply.
Timo Sirainen [Mon, 19 Oct 2015 10:49:54 +0000 (13:49 +0300)] 
director: Remember backends' hostnames and send them in login reply.
This allows login processes to verify the remote server's hostname in SSL
certificate.

7 years agodirector: Run director/host changing doveadm commands only after ring is synced
Timo Sirainen [Fri, 18 Aug 2017 08:51:36 +0000 (11:51 +0300)] 
director: Run director/host changing doveadm commands only after ring is synced

If the ring sync is still pending, the doveadm command may become reverted.
This doesn't fully prevent problems caused by sending doveadm commands
simultaneously to multiple directors, but it should prevent issues when
only a single director is used for doveadm commands.

It would have been nice to enable this also for HOST/DIRECTOR-LIST commands,
but they don't support returning a ring timeout error without changing the
protocol. It's a bit too much effort to change that for now.

7 years agodirector: doveadm HOST-* commands now wait for ring sync before returning OK
Timo Sirainen [Mon, 14 Aug 2017 07:29:47 +0000 (10:29 +0300)] 
director: doveadm HOST-* commands now wait for ring sync before returning OK

This should make it easier for tests and maybe for scripts in general, so
they won't think the command failed when it just takes a while to finish.

7 years agodirector: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret
Timo Sirainen [Mon, 14 Aug 2017 07:06:34 +0000 (10:06 +0300)] 
director: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret

7 years agodirector: Cleanup - Move all doveadm commands into an array.
Timo Sirainen [Mon, 14 Aug 2017 07:01:01 +0000 (10:01 +0300)] 
director: Cleanup - Move all doveadm commands into an array.

7 years agocassandra: Timestamp should be in microseconds, not milliseconds
Timo Sirainen [Tue, 19 Sep 2017 11:48:54 +0000 (14:48 +0300)] 
cassandra: Timestamp should be in microseconds, not milliseconds

7 years agocassandra: Fix paged queries to work again
Timo Sirainen [Wed, 13 Sep 2017 12:16:59 +0000 (15:16 +0300)] 
cassandra: Fix paged queries to work again

When continuing the result, consistency was reset to 0 (=ANY), which caused
the queries to fail. There's no need to initialize the statement again when
continuing it. Also set result->consistency to be correct mainly for
debugging purposes.

7 years agocassandra: Disable prepared statements with protocol v3 and older
Timo Sirainen [Tue, 12 Sep 2017 10:23:51 +0000 (13:23 +0300)] 
cassandra: Disable prepared statements with protocol v3 and older

7 years agocassandra: Add support for prepared statements
Timo Sirainen [Tue, 22 Aug 2017 11:35:11 +0000 (14:35 +0300)] 
cassandra: Add support for prepared statements

7 years agocassandra: Cleanup - Create statement earlier
Timo Sirainen [Tue, 22 Aug 2017 10:55:15 +0000 (13:55 +0300)] 
cassandra: Cleanup - Create statement earlier

Simplifies the following changes

7 years agocassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier
Timo Sirainen [Thu, 24 Aug 2017 08:56:38 +0000 (11:56 +0300)] 
cassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier

This makes the handling same for the sync and async method. It also
simplifies code for the following commits.

7 years agocassandra: sql_transaction_commit_s() - Set query_type correctly
Timo Sirainen [Thu, 24 Aug 2017 08:13:32 +0000 (11:13 +0300)] 
cassandra: sql_transaction_commit_s() - Set query_type correctly

The queries were all sent with READ type instead of WRITE/DELETE. This
meant they were using potentially wrong consistency values. Although
synchronous commits aren't actually used anywhere, so this practically
this doesn't fix anything right now.

7 years agocassandra: sql_transaction_commit_s() - Don't allow multi-query transactions
Timo Sirainen [Thu, 24 Aug 2017 08:09:05 +0000 (11:09 +0300)] 
cassandra: sql_transaction_commit_s() - Don't allow multi-query transactions

They were already denied for asynchronous commits. Also the synchronous
commits aren't actually used anywhere, so this shouldn't break anything.

7 years agodict-sql: Use prepared statements
Timo Sirainen [Thu, 7 Sep 2017 12:40:16 +0000 (15:40 +0300)] 
dict-sql: Use prepared statements

Create a hash table of query template -> prepared statement and fill it out
as needed. This could have been done some alternative ways that wouldn't
require building the string first, but this should still be fast enough and
much easier to implement.

7 years agodict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc
Timo Sirainen [Sat, 26 Aug 2017 20:27:21 +0000 (23:27 +0300)] 
dict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc

7 years agodict-sql: Cleanup - change query generator functions to return statement
Timo Sirainen [Sat, 26 Aug 2017 20:17:45 +0000 (23:17 +0300)] 
dict-sql: Cleanup - change query generator functions to return statement

Instead of query+params. This is in preparation for the following changes.

7 years agodict-sql: Cleanup - Remove unnecessary code
Timo Sirainen [Tue, 15 Aug 2017 13:50:16 +0000 (16:50 +0300)] 
dict-sql: Cleanup - Remove unnecessary code

The values are explicitly added to params. sql_dict_update_query() doesn't
add them again. Since the "diff" parameter is already a long long type,
this avoids unnecessary conversion to string and back.

7 years agodict-sql: Use sql_statement_bind_*()
Timo Sirainen [Tue, 15 Aug 2017 13:38:33 +0000 (16:38 +0300)] 
dict-sql: Use sql_statement_bind_*()

7 years agodict-sql: Add signed "int" type
Timo Sirainen [Tue, 15 Aug 2017 12:37:01 +0000 (15:37 +0300)] 
dict-sql: Add signed "int" type

7 years agodict-sql: Use sql_statement_set_timestamp() instead of adding it to query
Timo Sirainen [Tue, 15 Aug 2017 11:55:48 +0000 (14:55 +0300)] 
dict-sql: Use sql_statement_set_timestamp() instead of adding it to query

7 years agodict-sql: Initial change to use sql_statement API
Timo Sirainen [Tue, 15 Aug 2017 11:46:10 +0000 (14:46 +0300)] 
dict-sql: Initial change to use sql_statement API

sql_statement_bind_*() will be followed by later changes.

7 years agodict-sql: Remove dict_sql_build_query.inc
Timo Sirainen [Tue, 15 Aug 2017 13:44:27 +0000 (16:44 +0300)] 
dict-sql: Remove dict_sql_build_query.inc

It's no longer useful with the current code.

7 years agolib-dict: Moved/removed explicit stack frames in dict drivers.
Timo Sirainen [Fri, 6 May 2016 09:19:21 +0000 (12:19 +0300)] 
lib-dict: Moved/removed explicit stack frames in dict drivers.

Added them back to dict_set/unset/atomic_inc() in dict.c. Others are
unlikely to be called many times.

7 years agodict-sql: Change "uint" type to mean 64bit instead of 32bit integer.
Timo Sirainen [Tue, 15 Aug 2017 11:27:40 +0000 (14:27 +0300)] 
dict-sql: Change "uint" type to mean 64bit instead of 32bit integer.

This is likely what is usually wanted (especially in e.g. quotas).
If someone actually wants it to be restricted to 32bit, we could add
uint32 later on.

7 years agolib-sql: Add support for prepared SQL statements.
Timo Sirainen [Tue, 22 Aug 2017 08:37:17 +0000 (11:37 +0300)] 
lib-sql: Add support for prepared SQL statements.

This initial implementation doesn't use prepared statements in drivers, but
simply generates the query string internally.