MantisBT

View Issue Details Jump to Notes ] Wiki ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014563mantisbtdb oraclepublic2012-08-07 10:422012-11-27 05:55
Reporterdregad 
Assigned Todregad 
PrioritynormalSeveritymajorReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version1.2.12 
Target VersionFixed in Version 
Summary0014563: Use of literal SQL statement causes ORA-01704 error when uploading attachments
DescriptionAs reported by CarstenGrohmann in 0013227:0032489:

The literal SQL statements are limited to 2000 characters for Oracle. You've to use bind variables in such a case. See "Example 2 Inserting with bind variables" at http://php.net/manual/en/oci8.examples.php. [^]
Additional InformationError message reported by michalxo in 0013227:0032342:

Database query failed. Error received from database was 1704: ORA-01704: string literal too long for the query:

INSERT INTO m_bug_file_t
(bug_id, title, description, diskfile, filename, folder, filesize, file_type, date_added, content, user_id)
VALUES
(1, '', '', 'd81bba388aed666c7b91364208276a35', 'mantis_sql.txt', '', 30543, 'text/plain', '1342429120', '435245415445205441424c4520... ...2c20302c203020293b0d0a0d0a0d0a', 1)
TagsNo tags attached.
Attached Filespng file icon uploaded-file-db_query-vs-db_query_bound.png [^] (35,230 bytes) 2012-08-07 11:50

- Relationships
related to 0012955assigneddregad After updating a project documentation the file is damaged 
related to 0013099closeddregad Upload file causes application error 0000401 during insert into mantis_bug_file_table 
child of 0013227assigneddregad Oracle DB support multiple issues 

-  Notes
User avatar (0032491)
dregad (developer)
2012-08-07 10:48

The file_add() api function uses obsolete db_query() call instead of db_query_bound(); I will modify the code to call the new function (i.e. using bind variables) which hopefully will avoid the problem.
User avatar (0032492)
dregad (developer)
2012-08-07 11:51
edited on: 2012-08-07 12:09

Hmmm it may not be as easy as I thought - seems there is an issue with adodb and db_query_bound for uploading the file contents (see attached screenshot), the 1st file is an upload with db_query_bound, while the 2nd is with the current code (db_query); files seem somehow "corrupted" (same test with a png file results in an unreadable image)

User avatar (0032539)
dregad (developer)
2012-08-10 10:55
edited on: 2012-08-12 18:58

Please test a possible fix for this issue https://github.com/dregad/mantisbt/tree/oracle-fix-14563 [^] and let me know your feedback.

Note that I have not performed tests on Oracle myself (only MySQL) as my dev Oracle DB is not operational at the moment.


- Issue History
Date Modified Username Field Change
2012-08-07 10:42 dregad New Issue
2012-08-07 10:42 dregad Status new => assigned
2012-08-07 10:42 dregad Assigned To => dregad
2012-08-07 10:43 dregad Relationship added child of 0013227
2012-08-07 10:48 dregad Note Added: 0032491
2012-08-07 11:50 dregad File Added: uploaded-file-db_query-vs-db_query_bound.png
2012-08-07 11:51 dregad Note Added: 0032492
2012-08-07 12:09 dregad Note Edited: 0032492 View Revisions
2012-08-10 10:42 dregad Relationship added related to 0012955
2012-08-10 10:55 dregad Note Added: 0032539
2012-08-12 18:58 dregad Note Edited: 0032539 View Revisions
2012-11-27 05:55 dregad Relationship added related to 0013099


MantisBT 1.2.16dev master-1.2.x-8c2bd07 [^]
Copyright © 2000 - 2013 MantisBT Team
Time: 0.0856 seconds.
memory usage: 2,814 KB
Powered by Mantis Bugtracker