Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid filter expression #34

Open
dakapo opened this issue Mar 4, 2021 · 2 comments
Open

Invalid filter expression #34

dakapo opened this issue Mar 4, 2021 · 2 comments
Labels

Comments

@dakapo
Copy link

dakapo commented Mar 4, 2021

Hi everyone

I got the script running but it immediately stops with an exception.

trac:/usr/src/trac-hub/trac-hub# ./trac-hub
[2021-03-04 10:53:51] INFO | loading tickets
[2021-03-04 10:53:51] INFO | Last created issue on GitHub is '0'
[2021-03-04 10:53:51] INFO | migrating issues
[2021-03-04 10:53:51] INFO | creating issue 1 (dakapo)
Traceback (most recent call last):
10: from ./trac-hub:476:in '

'
9: from ./trac-hub:76:in 'migrate'
8: from ./trac-hub:109:in 'migrate_tickets'
7: from ./trac-hub:109:in 'each'
6: from ./trac-hub:127:in 'block in migrate_tickets'
5: from ./trac-hub:177:in 'compose_issue'
4: from ./trac-hub:261:in 'ticket_change'
3: from ./trac-hub:85:in 'trac_mail'
2: from /var/lib/gems/2.5.0/gems/sequel-5.42.0/lib/sequel/dataset/query.rb:1047:in 'where'
1: from /var/lib/gems/2.5.0/gems/sequel-5.42.0/lib/sequel/dataset/query.rb:1274:in 'add_filter'
/var/lib/gems/2.5.0/gems/sequel-5.42.0/lib/sequel/dataset/query.rb:1307:in 'filter_expr': Invalid filter expression: ["name = "email" AND sid = ?", "dakapo"] (Sequel::Error)

Is anybody out there that can help me with this issue?

@mavam mavam added the bug label Mar 4, 2021
@mavam
Copy link
Owner

mavam commented Mar 4, 2021

It sounds like Sequel no longer accepts raw strings.

Maybe an older version of Sequel works?

Unfortunately I lack the cycles to work on a patch.

@dakapo
Copy link
Author

dakapo commented Mar 5, 2021

I got this working by extending the following line.

@@ -82,7 82,7 @@ class Migrator
def trac_mail(author)
return @trac_mails_cache[author] if @trac_mails_cache.has_key?(author)
# tries to retrieve the email from trac db
- data = @trac.sessions.select(:value).where('name = "email" AND sid = ?', author)
data = @trac.sessions.select(:value).where(Sequel.lit('name = "email" AND sid = ?', author))
return (@trac_mails_cache[author] = data.first[:value]) if data.count == 1
return (@trac_mails_cache[author] = author) # not found
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants