developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.
#838 closed bug (fixed)
jDao conditions: field names should be enclosed in some db engines
Reported by: | Julien | Owned by: | Julien |
---|---|---|---|
Priority: | high | Milestone: | Jelix 1.1.1 |
Component: | jelix:dao | Version: | trunk |
Severity: | major | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Documentation needed: | no | |
Hosting Provider: | Php version: |
Description
In a table, I wanted to use a field named "order", but I had errors when using it in jDaoConditions.
So in some db engines, we need to escape those field names, like the way they are with generated dao methods with jDaoGenerator.
So I propose a new method: jDbConnection::encloseFieldName($fieldName) to deal with this.
Attachments (2)
Change History (11)
Changed 12 years ago by Julien
comment:1 Changed 12 years ago by Julien
- Status changed from new to assigned
comment:2 follow-up: ↓ 3 Changed 12 years ago by laurentj
- review changed from review? to review+
bad version in @since tags : it is 1.1.1, not 1.1
comment:3 in reply to: ↑ 2 Changed 12 years ago by Julien
- Resolution set to fixed
- Status changed from assigned to closed
Replying to laurentj:
bad version in @since tags : it is 1.1.1, not 1.1
oops, changed this ;)
committed in the trunk and 1.1.x, r1315
should I do something similar in 1.0.x ?
comment:4 Changed 12 years ago by thomas
- Resolution fixed deleted
- Status changed from closed to reopened
Il faut rajouter la méthode encloseFieldName dans la classe jDbPDOConnection aussi.
comment:5 Changed 12 years ago by Julien
ok, done it, works fine. I'm also writing unit tests, then submit a patch
Changed 12 years ago by Julien
comment:8 Changed 12 years ago by Julien
- Resolution set to fixed
- Status changed from reopened to closed
committed in the trunk and 1.1.x, r1338
comment:9 Changed 12 years ago by laurentj
I just renamed the method to encloseName, because it can be use to enclose table name too. r1340
Please note: lib/jelix/plugins/db/mysql/mysql.dbconnection.php seems to have lots of change, but that's because indentation was not correct (3 spaces instead of 4).
The only thing that is new is: