Gitea: Creating an issue with title ending in '?' fails

Created on 27 Sep 2019  路  5Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): c6fb7fe27c16c4e43d4d8dbe4d2ff4b3c4c52a29

Description

Creating an issue with title ending with ? fails with:

"could not determine data type of parameter $1"

However, the error is masked and the message actually logged (and displayed in the 500 Server Error page) is _different_ due to a problem introduced in #7898 (I'll file an issue for that as well).

@lunny I think this is a problem in xorm, but I can't pinpoint the cause to file an Issue over there.

I could trace the error into:

github.com/lib/pq.(*conn).QueryContext (\home\gprandi\src\pkg\mod\github.com\lib\[email protected]\conn_go18.go:20)
database/sql.ctxDriverQuery (\home\gprandi\go\src\database\sql\ctxutil.go:48)
database/sql.(*DB).queryDC.func1 (\home\gprandi\go\src\database\sql\sql.go:1592)
database/sql.withLock (\home\gprandi\go\src\database\sql\sql.go:3184)
database/sql.(*DB).queryDC (\home\gprandi\go\src\database\sql\sql.go:1587)
database/sql.(*Tx).QueryContext (\home\gprandi\go\src\database\sql\sql.go:2291)
xorm.io/core.(*Tx).QueryContext (\home\gprandi\src\pkg\mod\xorm.io\[email protected]\tx.go:87)
github.com/go-xorm/xorm.(*Session).queryRows (\home\gprandi\src\pkg\mod\github.com\go-xorm\[email protected]\session_raw.go:79)
github.com/go-xorm/xorm.(*Session).queryBytes (\home\gprandi\src\pkg\mod\github.com\go-xorm\[email protected]\session_raw.go:143)
github.com/go-xorm/xorm.(*Session).innerInsert (\home\gprandi\src\pkg\mod\github.com\go-xorm\[email protected]\session_insert.go:509)
github.com/go-xorm/xorm.(*Session).Insert (\home\gprandi\src\pkg\mod\github.com\go-xorm\[email protected]\session_insert.go:88)
code.gitea.io/gitea/models.newIssue (\home\gprandi\src\code.gitea.io\gitea\models\issue.go:1113)
code.gitea.io/gitea/models.NewIssue (\home\gprandi\src\code.gitea.io\gitea\models\issue.go:1210)
code.gitea.io/gitea/routers/repo.NewIssuePost (\home\gprandi\src\code.gitea.io\gitea\routers\repo\issue.go:574)
[... etc.]
kinbug

All 5 comments

8302 explains why the error above is not logged properly.

It doesn't have to be the title, and most of the time it doesn't have to be at the end of the text. A ? ending the issue content or comment makes it fail too. However, a ? in any position of the title makes it fail.

Example title failing: test?

@lunny for the moment I'd simply roll back the whole #7898 , since this is a problem in INSERT WHERE.

I have sent https://github.com/go-xorm/xorm/pull/1440 to fix the question mark problem. But I think it may have another problems. So I think to revert #7898 is a better choice currently.

This should be targeted for 1.10.0

closed by #8309

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cookiengineer picture cookiengineer  路  3Comments

lunny picture lunny  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

BNolet picture BNolet  路  3Comments

jakimfett picture jakimfett  路  3Comments