~emersion/soju-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] fix postgres/StoreNetwork positional arguments

Details
Message ID
<20230218143656.2028436-1-senan@senan.xyz>
DKIM signature
missing
Download raw message
Patch: +1 -1
---
hi! when updating a network i was getting this error:

    [728] ERROR:  inconsistent types deduced for parameter $14 at character 290
    [728] DETAIL:  bytea versus boolean
    [728] STATEMENT:  
        UPDATE "Network"
        SET name = $2, addr = $3, nick = $4, username = $5, realname = $6, certfp = $7, pass = $8,
                connect_commands = $9, sasl_mechanism = $10, sasl_plain_username = $11,
                sasl_plain_password = $12, sasl_external_cert = $13, sasl_external_key = $14,
                auto_away = $14, enabled = $15
        WHERE id = $1

it looks like in the postgres StoreNetwork query we have arg $14 listed twice. 
this patch fixes that and is working for me so far. thanks!

 database/postgres.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/database/postgres.go b/database/postgres.go
index 6faa695..e18cc05 100644
--- a/database/postgres.go
+++ b/database/postgres.go
@@ -574,7 +574,7 @@ func (db *PostgresDB) StoreNetwork(ctx context.Context, userID int64, network *N
			SET name = $2, addr = $3, nick = $4, username = $5, realname = $6, certfp = $7, pass = $8,
				connect_commands = $9, sasl_mechanism = $10, sasl_plain_username = $11,
				sasl_plain_password = $12, sasl_external_cert = $13, sasl_external_key = $14,
				auto_away = $14, enabled = $15
				auto_away = $15, enabled = $16
			WHERE id = $1`,
			network.ID, netName, network.Addr, nick, netUsername, realname, certfp, pass, connectCommands,
			saslMechanism, saslPlainUsername, saslPlainPassword, network.SASL.External.CertBlob,
-- 
2.39.2
Details
Message ID
<4Mn9TnRJ5ESJH4hU9P_nQDIHNDaCAhMRSjf5jbVh48ua9Ub7xnSw9FPiCFcbKdBnBIXqb2jJ42RdWLPi6PyCCXn1TKO5f7_zYGnbtxIM4lQ=@emersion.fr>
In-Reply-To
<20230218143656.2028436-1-senan@senan.xyz> (view parent)
DKIM signature
missing
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)