This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
discards 69c1c2f36c2893f82b9270782eb802a9f96df589 (commit)
via 25e4fac9844618f54fdb3ecf8cf3114071b7ecf8 (commit)
via 27d347f0d25f29fbd8245d860d387cc306398c42 (commit)
via e151c186e647aa111254eecbd900462933733984 (commit)
via 59a0894945676fd175d3c2206eefbdb7446be2bb (commit)
via ab2df13ad1841d8314d1325a1f2963d82041468b (commit)
via 4faa6b208560bedd676e785839c0368b8a511887 (commit)
via 633532ca1d2fc743cb64d2087359b8659a9bdb4a (commit)
via 8c2a92e206a4352c8cc4332f148a5566eadf3526 (commit)
via a37239b87bfedd8bc72b62431412a9cf5a17e48e (commit)
This update added new revisions after undoing existing revisions. That is
to say, the old revision is not a strict subset of the new revision. This
situation occurs when you --force push a change and generate a repository
containing something like this:
* -- * -- B -- O -- O -- O (69c1c2f36c2893f82b9270782eb802a9f96df589)
\
N -- N -- N (25e4fac9844618f54fdb3ecf8cf3114071b7ecf8)
When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/25e4fac9844618f54fdb3ecf8cf3114071b7ecf8
commit 25e4fac9844618f54fdb3ecf8cf3114071b7ecf8
Author: Oleg Broytman <ph...@ph...>
Date: Wed Oct 25 19:23:36 2023 +0300
Build: Prepare for the next release
[skip ci]
diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst
index 4b6d859..c2d4289 100644
--- a/ANNOUNCE.rst
+++ b/ANNOUNCE.rst
@@ -1,58 +1,26 @@
Hello!
-I'm pleased to announce version 3.10.3, the 3rd bugfix release of branch
-3.10 of SQLObject.
-
-
-What's new in SQLObject
-=======================
-
-The contributors for this release are
-Igor Yudytskiy and shuffle (github.com/shuffleyxf).
-Thanks!
+I'm pleased to announce version 3.10.4a1, the first alpha of the upcoming
+release of branch 3.10 of SQLObject.
-Bug fixes
----------
+I'm pleased to announce version 3.10.4a2, the second alpha of the upcoming
+release of branch 3.10 of SQLObject.
-* Relaxed aliasing in ``SQLRelatedJoin`` introduced in 3.10.2 - aliasing
- is required only when the table joins with itself. When there're two
- tables to join aliasing prevents filtering -- wrong SQL is generated
- in ``relJoinCol.filter(thisClass.q.column)``.
+I'm pleased to announce version 3.10.4b1, the first beta of the upcoming
+release of branch 3.10 of SQLObject.
-Drivers
--------
+I'm pleased to announce version 3.10.4rc1, the first release candidate
+of the upcoming release of branch 3.10 of SQLObject.
-* Fix(SQLiteConnection): Release connections from threads that are
- no longer active. This fixes memory leak in multithreaded programs
- in Windows.
-
- ``SQLite`` requires different connections per thread so
- ``SQLiteConnection`` creates and stores a connection per thread.
- When a thread finishes its connections should be closed.
- But if a program doesn't cooperate and doesn't close connections at
- the end of a thread SQLObject leaks memory as connection objects are
- stuck in ``SQLiteConnection``. On Linux the leak is negligible as
- Linux reuses thread IDs so new connections replace old ones and old
- connections are garbage collected. But Windows doesn't reuse thread
- IDs so old connections pile and never released. To fix the problem
- ``SQLiteConnection`` now enumerates threads and releases connections
- from non-existing threads.
-
-* Dropped ``supersqlite``. It seems abandoned.
- The last version 0.0.78 was released in 2018.
-
-Tests
------
+I'm pleased to announce version 3.10.4, the fourth bugfix release of branch
+3.10 of SQLObject.
-* Run tests with Python 3.12.
-CI
---
+What's new in SQLObject
+=======================
-* GHActions: Ensure ``pip`` only if needed
+The contributors for this release are ... Thanks!
- This is to work around a problem in conda with Python 3.7 -
- it brings in wrong version of ``setuptools`` incompatible with Python 3.7.
For a more complete list, please see the news:
http://sqlobject.org/News.html
@@ -84,7 +52,7 @@ Site:
http://sqlobject.org
Download:
-https://pypi.org/project/SQLObject/3.10.3
+https://pypi.org/project/SQLObject/3.10.4a0.dev20231025/
News and changes:
http://sqlobject.org/News.html
diff --git a/README.rst b/README.rst
index 39ece0b..e6db9d4 100644
--- a/README.rst
+++ b/README.rst
@@ -1,5 +1,5 @@
-SQLObject 3.10.3
-================
+SQLObject 3.10.4a0
+==================
SQLObject is a free and open-source (LGPL) Python object-relational
mapper. Your database tables are described as classes, and rows are
diff --git a/docs/News.rst b/docs/News.rst
index dabc193..c6a01e4 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -5,6 +5,9 @@ News
.. contents:: Contents:
:backlinks: none
+SQLObject (master)
+==================
+
SQLObject 3.10.3
================
http://sourceforge.net/p/sqlobject/sqlobject/ci/27d347f0d25f29fbd8245d860d387cc306398c42
commit 27d347f0d25f29fbd8245d860d387cc306398c42
Author: Oleg Broytman <ph...@ph...>
Date: Wed Oct 25 19:16:19 2023 +0300
Release 3.10.3
diff --git a/ANNOUNCE.rst b/ANNOUNCE.rst
index 216844c..4b6d859 100644
--- a/ANNOUNCE.rst
+++ b/ANNOUNCE.rst
@@ -1,37 +1,58 @@
Hello!
-I'm pleased to announce version 3.10.3a1, the first alpha of the upcoming
-release of branch 3.10 of SQLObject.
+I'm pleased to announce version 3.10.3, the 3rd bugfix release of branch
+3.10 of SQLObject.
-I'm pleased to announce version 3.10.3a2, the second alpha of the upcoming
-release of branch 3.10 of SQLObject.
-I'm pleased to announce version 3.10.3b1, the first beta of the upcoming
-release of branch 3.10 of SQLObject.
+What's new in SQLObject
+=======================
-I'm pleased to announce version 3.10.3rc1, the first release candidate
-of the upcoming release of branch 3.10 of SQLObject.
+The contributors for this release are
+Igor Yudytskiy and shuffle (github.com/shuffleyxf).
+Thanks!
-I'm pleased to announce version 3.10.3, the first bugfix release of branch
-3.10 of SQLObject.
+Bug fixes
+---------
+* Relaxed aliasing in ``SQLRelatedJoin`` introduced in 3.10.2 - aliasing
+ is required only when the table joins with itself. When there're two
+ tables to join aliasing prevents filtering -- wrong SQL is generated
+ in ``relJoinCol.filter(thisClass.q.column)``.
-What's new in SQLObject
-=======================
+Drivers
+-------
-The contributors for this release are ... Thanks!
+* Fix(SQLiteConnection): Release connections from threads that are
+ no longer active. This fixes memory leak in multithreaded programs
+ in Windows.
-Minor features
---------------
+ ``SQLite`` requires different connections per thread so
+ ``SQLiteConnection`` creates and stores a connection per thread.
+ When a thread finishes its connections should be closed.
+ But if a program doesn't cooperate and doesn't close connections at
+ the end of a thread SQLObject leaks memory as connection objects are
+ stuck in ``SQLiteConnection``. On Linux the leak is negligible as
+ Linux reuses thread IDs so new connections replace old ones and old
+ connections are garbage collected. But Windows doesn't reuse thread
+ IDs so old connections pile and never released. To fix the problem
+ ``SQLiteConnection`` now enumerates threads and releases connections
+ from non-existing threads.
-* Class ``Alias`` grows a method ``.select()`` to match ``SQLObject.select()``.
+* Dropped ``supersqlite``. It seems abandoned.
+ The last version 0.0.78 was released in 2018.
-Bug fixes
----------
+Tests
+-----
+
+* Run tests with Python 3.12.
+
+CI
+--
+
+* GHActions: Ensure ``pip`` only if needed
-* Fixed a bug in ``SQLRelatedJoin`` in the case where the table joins with
- itself; in the resulting SQL two instances of the table must use different
- aliases. Thanks to Igor Yudytskiy for providing an elaborated bug report.
+ This is to work around a problem in conda with Python 3.7 -
+ it brings in wrong version of ``setuptools`` incompatible with Python 3.7.
For a more complete list, please see the news:
http://sqlobject.org/News.html
@@ -63,7 +84,7 @@ Site:
http://sqlobject.org
Download:
-https://pypi.org/project/SQLObject/3.10.3a0.dev20230810/
+https://pypi.org/project/SQLObject/3.10.3
News and changes:
http://sqlobject.org/News.html
diff --git a/README.rst b/README.rst
index 074d26a..39ece0b 100644
--- a/README.rst
+++ b/README.rst
@@ -1,5 +1,5 @@
-SQLObject 3.10.3a0
-==================
+SQLObject 3.10.3
+================
SQLObject is a free and open-source (LGPL) Python object-relational
mapper. Your database tables are described as classes, and rows are
diff --git a/devscripts/build-all-docs b/devscripts/build-all-docs
index d633b09..4e7aaa5 100755
--- a/devscripts/build-all-docs
+++ b/devscripts/build-all-docs
@@ -10,7 +10,7 @@ cd "`dirname \"$0\"`" &&
PROG_DIR="`pwd`" &&
cd .. &&
-build_docs 3.10.2 &&
+build_docs 3.10.3 &&
build_docs master devel &&
rm -rf docs/html &&
diff --git a/docs/News.rst b/docs/News.rst
index e8ee45c..dabc193 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -5,8 +5,10 @@ News
.. contents:: Contents:
:backlinks: none
-SQLObject (master)
-==================
+SQLObject 3.10.3
+================
+
+Released 2023 Oct 25.
Bug fixes
---------
diff --git a/sqlobject/__version__.py b/sqlobject/__version__.py
index 8bf191f..c1c41ab 100644
--- a/sqlobject/__version__.py
+++ b/sqlobject/__version__.py
@@ -1,8 +1,8 @@
-version = '3.10.2'
+version = '3.10.3'
major = 3
minor = 10
-micro = 2
+micro = 3
release_level = 'final'
serial = 0
version_info = (major, minor, micro, release_level, serial)
http://sourceforge.net/p/sqlobject/sqlobject/ci/e151c186e647aa111254eecbd900462933733984
commit e151c186e647aa111254eecbd900462933733984
Author: Oleg Broytman <ph...@ph...>
Date: Thu Oct 19 16:53:52 2023 +0300
Fix(SQLRelatedJoin): Relax aliasing
Relaxed aliasing in `SQLRelatedJoin` introduced in 3.10.2 - aliasing
is required only when the table joins with itself. When there're two
tables to join aliasing prevents filtering -- wrong SQL is generated
in `relJoinCol.filter(thisClass.q.column)`.
diff --git a/docs/News.rst b/docs/News.rst
index b7c8e23..e8ee45c 100644
--- a/docs/News.rst
+++ b/docs/News.rst
@@ -8,6 +8,14 @@ News
SQLObject (master)
==================
+Bug fixes
+---------
+
+* Relaxed aliasing in ``SQLRelatedJoin`` introduced in 3.10.2 - aliasing
+ is required only when the table joins with itself. When there're two
+ tables to join aliasing prevents filtering -- wrong SQL is generated
+ in ``relJoinCol.filter(thisClass.q.column)``.
+
Drivers
-------
diff --git a/sqlobject/joins.py b/sqlobject/joins.py
index fa2b337..34d9c59 100644
--- a/sqlobject/joins.py
+++ b/sqlobject/joins.py
@@ -291,52 +291,63 @@ class RelatedJoin(MultipleJoin):
class OtherTableToJoin(sqlbuilder.SQLExpression):
- def __init__(self, otherTable, otherIdName, interTable, joinColumn):
+ def __init__(self, otherTable, otherIdName, interTable, joinColumn, alias):
self.otherTable = otherTable
self.otherIdName = otherIdName
self.interTable = interTable
self.joinColumn = joinColumn
+ self.alias = alias
def tablesUsedImmediate(self):
return [
- '%s _SO_SQLRelatedJoin_OtherTable' % self.otherTable,
+ '%s %s' % (self.otherTable, self.alias)
+ if self.alias else self.otherTable,
self.interTable,
]
def __sqlrepr__(self, db):
- return '_SO_SQLRelatedJoin_OtherTable.%s = %s.%s' % (
+ return '%s.%s = %s.%s' % (
+ self.alias if self.alias else self.otherTable,
self.otherIdName, self.interTable, self.joinColumn)
class JoinToTable(sqlbuilder.SQLExpression):
- def __init__(self, table, idName, interTable, joinColumn):
+ def __init__(self, table, idName, interTable, joinColumn, alias):
self.table = table
self.idName = idName
self.interTable = interTable
self.joinColumn = joinColumn
+ self.alias = alias
def tablesUsedImmediate(self):
return [
- '%s _SO_SQLRelatedJoin_ThisTable' % self.table,
+ '%s %s' % (self.table, self.alias)
+ if self.alias else self.table,
self.interTable,
]
def __sqlrepr__(self, db):
- return '%s.%s = _SO_SQLRelatedJoin_ThisTable.%s' % (
- self.interTable, self.joinColumn, self.idName)
+ return '%s.%s = %s.%s' % (
+ self.interTable, self.joinColumn,
+ self.alias if self.alias else self.table, self.idName)
class TableToId(sqlbuilder.SQLExpression):
- def __init__(self, table, idName, idValue):
+ def __init__(self, table, idName, idValue, alias):
self.table = table
self.idName = idName
self.idValue = idValue
+ self.alias = alias
def tablesUsedImmediate(self):
- return ['%s _SO_SQLRelatedJoin_ThisTable' % self.table]
+ return [
+ '%s %s' % (self.table, self.alias)
+ if self.alias else self.table,
+ ]
def __sqlrepr__(self, db):
- return '_SO_SQLRelatedJoin_ThisTable.%s = %s' % (
+ return '%s.%s = %s' % (
+ self.alias if self.alias else self.table,
self.idName, self.idValue)
@@ -346,23 +357,33 @@ class SOSQLRelatedJoin(SORelatedJoin):
conn = inst._connection
else:
conn = None
- results = sqlbuilder.Alias(
- self.otherClass, '_SO_SQLRelatedJoin_OtherTable'
- ).select(sqlbuilder.AND(
+ needAlias = self.soClass is self.otherClass
+ if needAlias:
+ source = sqlbuilder.Alias(
+ self.otherClass, '_SO_SQLRelatedJoin_OtherTable')
+ else:
+ source = self.otherClass
+ results = source.select(sqlbuilder.AND(
OtherTableToJoin(
self.otherClass.sqlmeta.table, self.otherClass.sqlmeta.idName,
- self.intermediateTable, self.otherColumn
+ self.intermediateTable, self.otherColumn,
+ '_SO_SQLRelatedJoin_OtherTable' if needAlias else '',
),
JoinToTable(
self.soClass.sqlmeta.table, self.soClass.sqlmeta.idName,
- self.intermediateTable, self.joinColumn
+ self.intermediateTable, self.joinColumn,
+ '_SO_SQLRelatedJoin_ThisTable' if needAlias else '',
+ ),
+ TableToId(
+ self.soClass.sqlmeta.table, self.soClass.sqlmeta.idName,
+ inst.id, '_SO_SQLRelatedJoin_ThisTable' if needAlias else '',
),
- TableToId(self.soClass.sqlmeta.table, self.soClass.sqlmeta.idName,
- inst.id),
), clauseTables=(
- '%s _SO_SQLRelatedJoin_ThisTable' % self.soClass.sqlmeta.table,
+ '%s _SO_SQLRelatedJoin_ThisTable' % self.soClass.sqlmeta.table
+ if needAlias else self.soClass.sqlmeta.table,
'%s _SO_SQLRelatedJoin_OtherTable' %
- self.otherClass.sqlmeta.table,
+ self.otherClass.sqlmeta.table
+ if needAlias else self.otherClass.sqlmeta.table,
self.intermediateTable),
connection=conn)
return results.orderBy(self.orderBy)
diff --git a/sqlobject/tests/test_SQLRelatedJoin.py b/sqlobject/tests/test_SQLRelatedJoin.py
index 5e235dd..e7d7e41 100644
--- a/sqlobject/tests/test_SQLRelatedJoin.py
+++ b/sqlobject/tests/test_SQLRelatedJoin.py
@@ -1,6 +1,7 @@
import pytest
from sqlobject import RelatedJoin, SQLObject, SQLRelatedJoin, StringCol, \
ForeignKey
+from sqlobject.sqlbuilder import Alias
from sqlobject.tests.dbtest import setupClass, supports
@@ -24,7 +25,7 @@ def createAllTables():
setupClass(Tourtment)
-def test_1():
+def createData():
createAllTables()
# create some tourtments
t1 = Tourtment(name='Tourtment #1')
@@ -44,7 +45,11 @@ def test_1():
t2.addFighter(trunks)
t3.addFighter(gohan)
t3.addFighter(trunks)
- # do some selects
+ return t1, t2, t3, gokou, vegeta, gohan, trunks
+
+
+def test_1():
+ t1, t2, t3, gokou, vegeta, gohan, trunks = createData()
for i, j in zip(t1.fightersAsList, t1.fightersAsSResult):
assert i is j
assert len(t2.fightersAsList) == t2.fightersAsSResult.count()
@@ -65,6 +70,15 @@ def test_related_join_transaction():
Tourtment._connection.autoCommit = True
... 822 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|