Issue 25041

Summary: memo field truncates entry despite enough size ( postgres odbc)
Product: Base Reporter: andremachado <andremachado>
Component: codeAssignee: ocke.janssen
Status: CLOSED FIXED QA Contact: issues@dba <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: OOo 1.1.1a   
Target Milestone: OOo 2.0   
Hardware: PC   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
sample postgresql db with memo field
none
sample text for memo field entry with hard break returns
none
sample form that truncate long memo field
none
new version of desired memo field content, with hard line breaks, that is truncated by OOo none

Description andremachado 2004-02-03 17:20:21 UTC
Sir: 
When entering text into a memo field to a PostgreSQL database conected through official 
psqlodbc 07_03_100 postgresql odbc driver from www.postgresql.org (v7.03.200 is too buggy 
for practical use), it truncates text at 512 chars, despite memo field allowing 8190 for 
postgresql. 
The workaround, for now, is to configure field size manually, instead of automatic (0 size). 
I do not know if the issue is the odbc driver not returning correct field size or OOo not 
processing right the info. 
Please, let me know where is the bug. If it is at psqlodbc, i will post an issue at their site. 
Regards. 
Andre Felipe
Comment 1 marc.neumann 2004-02-12 10:40:30 UTC
Hi,

I can reproduce this.

When you select the field contant in the beamer then you don't get all
characters. When you D&D the records to a document then you get all characters.
As far as I can see all characters are stored correct in the database. So it's
more an 'visiable' error.

target to OOo 2.0.

Bye Marc
Comment 2 andremachado 2004-03-11 18:55:43 UTC
Created attachment 13725 [details]
sample postgresql db with memo field
Comment 3 andremachado 2004-03-11 18:58:05 UTC
Created attachment 13726 [details]
sample text for memo field entry with hard break returns
Comment 4 andremachado 2004-03-11 19:01:09 UTC
Created attachment 13727 [details]
sample form that truncate long memo field
Comment 5 andremachado 2004-03-11 19:10:06 UTC
Hello, 
I attached some sample files to help clarify the issue. 
When I try to insert long text, containing hard break lines (returns), to a memo field (8190 chars 
in a Pg db) into a form, OOo 1.1.1.a truncates the content and stores the truncated content. 
I checked using a pg_dump that the content is actually truncated. 
You could use the sample txt file containing a long text with some hard breaks. 
For each hard line break, OOo seems to cut around 60 chars of the text. 
 
If you input the text as a very long paragraph, it will accept almost the entire text. 
OOo truncates the LAST hard line break, cutting the previous character. 
 
I would like to be able to input some text written in "normal" way, with hard line breaks at 
suitable end of paragraphs. 
Please, try to reproduce with these files. 
Regards. 
Andre Felipe 
 
Comment 6 andremachado 2004-03-11 20:15:36 UTC
Hello, 
I read the link 
http://www.postgresql.org/docs/7.3/interactive/sql-syntax.html#SQL-SYNTAX-STRINGS 
And guessing that the problem could be the escaping hard line breaks. 
 
"C-style backslash escapes are also available: \b is a backspace, \f is a form feed, \n is a 
newline, \r is a carriage return, \t is a tab, and \xxx, where xxx is an octal number, is the 
character with the corresponding ASCII code. Any other character following a backslash is 
taken literally. Thus, to include a backslash in a string constant, type two backslashes. " 
 
I hope this helps. 
Andre Felipe 
Comment 7 andremachado 2004-03-12 12:20:29 UTC
Created attachment 13745 [details]
new version of desired memo field content, with hard line breaks, that is truncated by OOo
Comment 8 andremachado 2004-03-16 18:29:19 UTC
Hello,
I compiled and installed Rekall 2.2.0b2 ( http://www.rekallrevealed.org ) at 
another linux machine and inserted the entire field content.
Then, at OOo for windows, called mail merge tool to generate a report 
containing the memo field.
OOo can print the entire content.
(a new line char being also printed, but for now I guess it is a 
misconfiguration of charset or rekall driver parameter I forgot).
OOo can DISPLAY the entire content only the first time the record is displayed.
If one move to another record and come back, the field content is truncated now.
So, it seems to be a forms problem.
I hope this info helps.
Regards.
Andre Felipe
Comment 9 marc.neumann 2004-03-29 11:40:09 UTC
reassign to oj.

msc -> oj: please see my last comment.
Comment 10 ocke.janssen 2004-05-18 14:21:08 UTC
Hi Andre,

the problem seems to be psqlodbc. When I insert the value, all works fine. But
when I refetch the value again, it's truncated. All what OOo does is:

- fetch next
- SQLGetData call 
-> when called a second time after a refetch, the pcbValue (the returned length)
is one less the size I aks for. The orginal size, in this case, was 2467 and I
asked for 2047.

It would be great, if you could file a bug at the psqlodbc site.

Best regards,

Ocke

PS: The problem with the \n is fixed in another issue.
PPS: I'd tried also the 7.3.2009 version and this one truncated my string to the
length of 1. :-(
Comment 11 andremachado 2004-05-18 15:34:26 UTC
Hello,
Many thanks for your message.
I posted a bug report at the psqlodbc site and a post to the users/dev list 
with a few more details and your report.
I hope these info help them.
Many thanks.
Andre Felipe
Comment 12 andremachado 2004-05-19 15:04:33 UTC
Hello, OJ 
Sorry for my english. 
I read again and realized that you did not see the problem at INSERTING long text. 
If you use OOo to insert a long stream of data into a memo text field, the OOo "SEEMS" to 
insert it. 
Then, if you reload database, or exit OOo and windows session (odbc data cache flushed), or if 
you use another machine to see the record (I tested with rekall), then you will see that the data 
was not INSERTED completely. 
If you insert long stream of text into a memo text field using Rekall, or another program like 
PgAccess, you could see the data using them AND using OOo. 
OOo can DISPLAY the long text, but can not insert it. 
So, where is the problem of inserting? It is at OOo or psqlodbc? 
Many thanks. 
Andre Felipe 
 
Comment 13 ocke.janssen 2004-05-21 09:19:02 UTC
Hi Andre,

I made a mistake. Sorry.
There were some little paragraphs about SQLGetData and about SQLPutData which I
doesn't get int my mind before. :-) Now I fixed the bug in the cws insight01.

Sorry for the misunderstanding.

Best regards,

Ocke
Comment 14 ocke.janssen 2004-05-21 09:20:32 UTC
Set to fixed.

I used the driver version 7.03.209
The other drivers doesn't support to set the data at execution point.
Comment 15 ocke.janssen 2004-05-21 09:25:18 UTC
.
Comment 16 marc.neumann 2004-06-16 15:02:25 UTC
verify in CWS insight01
Comment 17 ocke.janssen 2004-09-06 11:59:15 UTC
.