Opened 10 years ago
Closed 10 years ago
#5466 closed enhancement (fixed)
ogr-oci: ORA-00972: identifier is too long
Reported by: | martinl | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.11.1 |
Component: | OGR_SF | Version: | svn-trunk |
Severity: | normal | Keywords: | ogr, oci, ORA-00972 |
Cc: | ilucena |
Description
OGR OCI driver doesn't check length of column names ORA-00972 when writing data. If the length is more than 30 characters than adding such column fails. The attached patch avoids such failure, see warning below:
Warning 1: Column BonitovanyDilBonitovanaJednotkaKod is too long (at most 30 characters). Using BonitovanyDilBonitovanaJednot_.
Attachments (1)
Change History (8)
by , 10 years ago
Attachment: | oci-ora-00972.diff added |
---|
follow-up: 2 comment:1 by , 10 years ago
Cc: | added |
---|
Martin,
apart szFieldName[sizeof( szFieldName )] = '\0'; which looks like a 1-byte-after-end-of-buffer and potential indentation issue (tabulation), I think you can go ahead with the patch.
follow-up: 3 comment:2 by , 10 years ago
Replying to rouault:
apart szFieldName[sizeof( szFieldName )] = '\0'; which looks like a 1-byte-after-end-of-buffer and potential indentation issue (tabulation), I think you can go ahead with the patch.
done in r27449. Both notes reflected. After some testing I will do backport (if no objections) to 1.11 branch.
Martin
comment:3 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 5 comment:4 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Martin, r27582 looks wrong at szFieldName[sizeof( szFieldName )] = '\0'; . It has the 1-byte-after-end-of-buffer write that r27449 as not. By the way, I think (should be verified, the snprintf man page isn't completely clear) that snprintf() always null terminate (contrary to strncpy !) so the line might be not needed at all.
follow-up: 6 comment:5 by , 10 years ago
Replying to rouault:
Martin, r27582 looks wrong at szFieldName[sizeof( szFieldName )] = '\0'; . It has the 1-byte-after-end-of-buffer write that r27449 as not. By the way, I think (should be verified, the snprintf man page isn't completely clear) that snprintf() always null terminate (contrary to strncpy !) so the line might be not needed at all.
ops, sorry, should be hopefully fixed in r27583.
comment:6 by , 10 years ago
Replying to martinl:
Replying to rouault:
Martin, r27582 looks wrong at szFieldName[sizeof( szFieldName )] = '\0'; . It has the 1-byte-after-end-of-buffer write that r27449 as not. By the way, I think (should be verified, the snprintf man page isn't completely clear) that snprintf() always null terminate (contrary to strncpy !) so the line might be not needed at all.
ops, sorry, should be hopefully fixed in r27583.
possible to close this ticket?
comment:7 by , 10 years ago
Milestone: | 2.0 → 1.11.1 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
avoid ora-00972 for column names