Closed
Bug 312508
Opened 18 years ago
Closed 17 years ago
Two SQL queries contain "LIMIT" keyword instead of calling sql_limit()
Categories
(Bugzilla :: Database, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.0
People
(Reporter: lance.larsh, Assigned: lance.larsh)
References
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041119 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041119 The following queries are using the LIMIT keyword explicitly, rather than invoking the db-specific method $dbh->sql_limit(). Namely: Bugzilla/DB/Schema.pm:1484 push(@statements, "SELECT CAST($column AS $type) FROM $table LIMIT 1"); Bugzilla/User.pm:1182 LIMIT 1"); These queries fail on Oracle as a result. Reproducible: Always Steps to Reproduce:
Assignee | ||
Comment 1•18 years ago
|
||
(In reply to comment #0) > Bugzilla/DB/Schema.pm:1484 push(@statements, "SELECT CAST($column AS $type) > FROM $table LIMIT 1"); This query is a little tricky because it's in Bugzilla::DB::Schema::get_alter_column_ddl(). Since that method doesn't take $dbh as a parameter, there's no easy way to invoke sql_limit() from there.
Comment 2•18 years ago
|
||
Yeah, that one is a bit tricky. You basically have two choices: (1) Re-write get_alter_column_ddl for your DB (which I think you'll have to do anyway, yeah?) (2) Make the Schema constructor take a reference to a Bugzilla::DB object that it can use. If you do this, make sure to specify in the internal Bugzilla::DB::Schema documentation that the $dbh that is passed in should *only* be used to get information about the database, and should *never* interact with the database directly, as that's forbidden in Schema.pm.
Assignee: database → lance.larsh
Status: UNCONFIRMED → NEW
Ever confirmed: true
![]() |
||
Comment 4•17 years ago
|
||
Bug 329537 removed LIMIT 1 from DB::Schema::get_alter_column_ddl(). All other "LIMIT" are in there DB-specific file, so this bug is fixed.
Status: NEW → RESOLVED
Closed: 17 years ago
No longer depends on: 300551
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 3.0
You need to log in
before you can comment on or make changes to this bug.
Description
•