Modify ↓
#11913 closed enhancement (fixed)
Remove use of deprecated get_read_db
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.1.4 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Replaced use of deprecated |
||
API Changes: | |||
Internal Changes: |
Description
There are numerous uses of Environment.get_read_db
in the codebase, including the tests.
./trac/ticket/query.py: db = self.env.get_read_db() ./trac/ticket/query.py: db = self.env.get_read_db() ./trac/ticket/report.py: return self.env.get_read_db().concat(*parts) ./trac/ticket/tests/query.py: 'cast_priority': self.env.get_read_db().cast('priority.value', 'int')}) ./trac/ticket/tests/query.py: 'cast_priority': self.env.get_read_db().cast('priority.value', 'int')}) ./trac/ticket/tests/query.py: 'cast_priority': self.env.get_read_db().cast('priority.value', 'int')}) ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/query.py: foo = self.env.get_read_db().quote('foo') ./trac/ticket/tests/query.py: foo = self.env.get_read_db().quote('foo') ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/query.py: 'cast_time': self.env.get_read_db().cast('t.time', 'int64')}) ./trac/ticket/tests/query.py: 'cast_time': self.env.get_read_db().cast('t.time', 'int64')}) ./trac/ticket/tests/query.py: 'cast_time': self.env.get_read_db().cast('t.time', 'int64')}) ./trac/ticket/tests/query.py: 'cast_time': self.env.get_read_db().cast('t.time', 'int64')}) ./trac/ticket/tests/query.py: 'cast_changetime': self.env.get_read_db().cast('t.changetime', 'int64')}) ./trac/ticket/tests/query.py:ORDER BY COALESCE(t.id,0)=0,t.id""" % {'like': self.env.get_read_db().like()}) ./trac/ticket/tests/report.py: self.assertEqual(self.env.get_read_db().concat("''", '%s', "''"), sql) ./trac/ticket/tests/report.py: db = self.env.get_read_db() ./trac/upgrades/db18.py: """ % env.get_read_db().cast('s2.var_value', 'int')) ./trac/upgrades/db25.py: db = env.get_read_db() ./trac/upgrades/db21.py: owner = env.get_read_db().concat('owner', "' *'") ./trac/db/tests/api.py: db = self.env.get_read_db() ./trac/db/tests/api.py: db = self.env.get_read_db() ./trac/db/tests/api.py: db = self.env.get_read_db() ./trac/versioncontrol/cache.py: db = self.env.get_read_db()
Attachments (0)
Change History (5)
comment:1 by , 10 years ago
Owner: | set to |
---|---|
Release Notes: | modified (diff) |
Status: | new → assigned |
comment:2 by , 10 years ago
Release Notes: | modified (diff) |
---|
comment:3 by , 10 years ago
Looks good with except Python 2.5.
... File "/run/shm/fec2da7c66c70ef9a77310655463753dfa67fa4a/py25-sqlite/trac/ticket/tests/__init__.py", line 18, in <module> from trac.ticket.tests import api, model, query, wikisyntax, notification, \ File "/run/shm/fec2da7c66c70ef9a77310655463753dfa67fa4a/py25-sqlite/trac/ticket/tests/query.py", line 104 with self.env.db_query as db: ^ SyntaxError: invalid syntax make: *** [unit-test] Error 1
comment:4 by , 10 years ago
Milestone: | 1.0.4 → 1.1.4 |
---|
Thanks for spotting that issue. I'll apply the changes to the trunk instead.
comment:5 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed in [13669:13670] (sorry for the ugly changes, I got distracted while doing the cherry-pick and forgot to run the tests).
Note:
See TracTickets
for help on using tickets.
Proposed changes in log:rjollos.git:t11913-remove-uses-of-get_read_db. I'll do some testing of the upgrade steps before committing the changes.