Menu

#1748 Strange characters and blank lines with text tables in a transaction

current-release
open
nobody
None
5
2026-03-21
2026-03-21
No

Hello, I am using a text table, and I have found that when I do updates as part of a session without auto commit, I get unexpected lines and characters in the csv file when I commit the transaction.
Please find attached the DB, and as you can see the text file contains blank lines with varying numbers of spaces in, and lines with a character rendered as "NUL" in Notepad++ and which has int value 0 in Java.
If you open the DB and then, from a non auto-committing session, do:

insert into dynamichsqldbexample (row_num) values (default)
update dynamichsqldbexample set col_id='xxx' where row_num=(select max(row_num) from dynamichsqldbexample)
update dynamichsqldbexample set col_testfeature1='yyyy' where row_num=(select max(row_num) from dynamichsqldbexample)
update dynamichsqldbexample set col_testfeature2=TRUE where row_num=(select max(row_num) from dynamichsqldbexample)
commit

then see the changes in the csv file.
I have had cases updating the table from my Java application where the file is left in a state that it cannot be read anymore, and the table has no data and is read-only; however I can't reproduce this outside of my Java app.
Thanks

1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB