Modify

Opened 11 years ago

Closed 11 years ago

#11071 closed defect (fixed)

Doesn't work with postgresql

Reported by: anonymous Owned by: bphinz
Priority: normal Component: FieldGroupsPlugin
Severity: normal Keywords: string interpolation db api postgresql
Cc: Trac Release: 1.0

Description (last modified by Ryan J Ollos)

File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/web/main.py", line 497, in _dispatch_request
  dispatcher.dispatch(req)
File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/web/main.py", line 214, in dispatch
  resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/admin/web_ui.py", line 125, in process_request
  path_info)
File "/usr/local/lib/python2.7/dist-packages/FieldGroups-0.0.1-py2.7.egg/fieldgroups/admin.py", line 116, in render_admin_panel
  data = {'fieldgroups': api.get_field_groups(), 'view':'list'}
File "/usr/local/lib/python2.7/dist-packages/FieldGroups-0.0.1-py2.7.egg/fieldgroups/api.py", line 62, in get_field_groups
  cursor.execute(sql)
File "/usr/local/lib/python2.7/dist-packages/Trac-1.0-py2.7.egg/trac/db/util.py", line 66, in execute
  return self.cursor.execute(sql)

Attachments (0)

Change History (7)

comment:1 Changed 11 years ago by Ryan J Ollos

Description: modified (diff)
Trac Release: 1.0

comment:2 Changed 11 years ago by Ryan J Ollos

Summary: Can't co work with postgresqlDoesn't work with postgresql

String interpolation should not be used for preparing the SQL, per t:TracDev/DatabaseApi#RulesforDBAPIUsage. I will prepare a patch.

comment:3 Changed 11 years ago by Ryan J Ollos

Patch for the issue in this ticket can be found in t11071. I'm happy to push it straight to the t-h.o repository if bphinz is okay with that, but I'll wait at least 2 weeks for a response per the non-maintainer commit policies in AdoptingHacks.

anonymous: could you please test out the branch and let us know if it works for you?

With regard to the branch on GitHub, I'm trying out something new. I've imported the entire trac-hacks SVN repository to GitHub, and rather than creating a repository for every project on trac-hacks, I'm just making a branch of the entire t-h.o repository.

The only major downside I see to this is that it could take too long for another user to clone the repository. I ran a timing test just now, and here is the result I got:

user@ubuntu:~/Workspace$ time git clone https://github.com/rjollos/trachacks.git temp.git
Cloning into 'temp.git'...
remote: Counting objects: 106907, done.
remote: Compressing objects: 100% (46085/46085), done.
remote: Total 106907 (delta 50453), reused 106895 (delta 50441)
Receiving objects: 100% (106907/106907), 95.30 MiB | 706 KiB/s, done.
Resolving deltas: 100% (50453/50453), done.
real    3m15.866s
user    0m5.492s
sys 0m16.041s

I'm anticipating that should be manageable for most users to work with.

comment:4 Changed 11 years ago by Ryan J Ollos

Keywords: string interpolation db api postgresql added

comment:5 in reply to:  3 Changed 11 years ago by bphinz

Replying to rjollos:

Patch for the issue in this ticket can be found in t11071. I'm happy to push it straight to the t-h.o repository if bphinz is okay with that, but I'll wait at least 2 weeks for a response per the non-maintainer commit policies in AdoptingHacks.

The patch looks good to me, please go ahead and commit it to the t-h.o repo. I've probably done something similar in my other plugins, I'll review those and patch as necessary. Thanks.

comment:6 Changed 11 years ago by Ryan J Ollos

(In [13213]) Refs #11071: Replaced string interpolation in SQL strings with proper argument passing to the Trac Database API. This should resolve cross-DB compatibility issues, including the PostgreSQL issues described in #11071.

comment:7 Changed 11 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

anonymous: Please reopen if you continue to have trouble using the plugin with PostgreSQL.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bphinz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.