Menu

#451 (ok 3.2) support column name having square brackets

closed-accepted
None
1
2009-06-15
2009-02-15
No

Full bug title: insert into field like "col[a]" fails (Unknown column)

I've confirmed this bug's behaviour in two places: tbl_relation.php and tbl_change.php

Both use the fieldname inside square brackets in a HTML name attribute.

Since according to MySQL a filedname like "foo[bar]" is allowed I think we should not fail on this.
Also, when other exotic characters are used in a fieldname this may not go well. But it would certainly violate the html specs.

My solution is to include an extra hidden HTML field containing the fieldname. A mapping to this can be done using a md5 of the fieldname.

Whenever $key is used in tbl_replace.php to represent the fieldname explicitly, a mapping is required using "$me_fields_name[$key]".

Discussion

  • Herman van Rink

    Herman van Rink - 2009-02-15

    patch for bug#1746964

     
  • Marc Delisle

    Marc Delisle - 2009-02-20
    • assigned_to: nobody --> lem9
     
  • Marc Delisle

    Marc Delisle - 2009-02-20
    • summary: insert into field like "col[a]" fails (bug #1746964) --> (ok 3.2) support column name having square brackets
    • priority: 5 --> 1
    • status: open --> open-accepted
     
  • Marc Delisle

    Marc Delisle - 2009-02-20

    Merged in subversion, thanks.

     
  • Marc Delisle

    Marc Delisle - 2009-02-23
    • priority: 1 --> 5
     
  • Marc Delisle

    Marc Delisle - 2009-02-23

    Herman,
    could you have a look at this: after applying this patch to trunk (revision 12243) we no longer can upload a file to a BLOB when inserting or editing a row.

     
  • Herman van Rink

    Herman van Rink - 2009-02-23

    I think I found the problem in several html name attributes of which the value was not yet updated.

    I'll try to do some more testing this evening, and hopefully commit it myself by then :).

     
  • Herman van Rink

    Herman van Rink - 2009-02-23

    Committed to trunk in rev 12246.

     
  • Marc Delisle

    Marc Delisle - 2009-02-24
    • assigned_to: lem9 --> helmo
     
  • Marc Delisle

    Marc Delisle - 2009-02-24
    • priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2009-03-31

    See also revision 12331 for a fix: patch #2602633 broke the unNullify() mechanism.

     
  • Eelko Berkenpies

    Works like a charm! This definitely fixes bug#1746964 for me. A quick test proofed me that it's no longer a problem to edit (multiple) fields (at once) that contain brackets.

    Thanks a lot Herman (and lem9 for merging)!

    If there's anything else worth reporting, I'll let you know. :)

     
  • Marc Delisle

    Marc Delisle - 2009-06-15
    • status: open-accepted --> closed-accepted
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.