head 1.2; access; symbols pkgsrc-2026Q1:1.1.0.4 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.2 pkgsrc-2025Q4-base:1.1; locks; strict; comment @# @; 1.2 date 2026.04.16.19.15.13; author wiz; state dead; branches; next 1.1; commitid r8AJI4rw2IH4ydCG; 1.1 date 2025.12.02.22.28.59; author wiz; state Exp; branches; next ; commitid ccD31CaieunDXSkG; desc @@ 1.2 log @syncstorage-rs: remove This hasn't been working for months. Moved to wip. @ text @$NetBSD: patch-syncstorage-mysql_src_diesel__ext.rs,v 1.1 2025/12/02 22:28:59 wiz Exp $ Improve mariadb compatibility https://github.com/felfert/syncstorage-rs-rpm/commit/c9311a47b89cb02c4a248e36d608571fe3097f9e --- syncstorage-mysql/src/diesel_ext.rs.orig 2025-09-23 20:12:34.000000000 +0000 +++ syncstorage-mysql/src/diesel_ext.rs @@@@ -3,11 +3,43 @@@@ use std::{fmt::Debug, marker::PhantomDat use diesel::{ backend::Backend, insertable::CanInsertInSingleQuery, + mysql::Mysql, query_builder::{AstPass, InsertStatement, QueryFragment, QueryId}, + query_dsl::methods::LockingDsl, result::QueryResult, Expression, QuerySource, RunQueryDsl, }; +/// Emit MySQL <= 5.7's `LOCK IN SHARE MODE` +/// +/// MySQL 8 supports `FOR SHARE` as an alias (which diesel natively supports) +pub trait LockInShareModeDsl { + type Output; + + fn lock_in_share_mode(self) -> Self::Output; +} + +impl LockInShareModeDsl for T +where + T: LockingDsl, +{ + type Output = >::Output; + + fn lock_in_share_mode(self) -> Self::Output { + self.with_lock(LockInShareMode) + } +} + +#[derive(Debug, Clone, Copy, QueryId)] +pub struct LockInShareMode; + +impl QueryFragment for LockInShareMode { + fn walk_ast<'b>(&'b self, mut out: AstPass<'_, 'b, Mysql>) -> QueryResult<()> { + out.push_sql(" LOCK IN SHARE MODE"); + Ok(()) + } +} + #[allow(dead_code)] // Not really dead, Rust can't see it. #[derive(Debug, Clone)] pub struct OnDuplicateKeyUpdate( @ 1.1 log @syncstorage-rs: add two patches Improve mariadb compat. Support logging in release. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ @