Does TEXT in MySQL retain spaces/formatting for XML?
If I embed XML into a TEXT column in MySQL, will it retain the spacing/indentation of the XML blob? Will I need to fix the开发者_C百科 markup when I retrieve it so it isn't just a long string?
Per the docs, the text you put in will stay untouched (except for possible truncation if you try to put more text in than the datatype can accept). Indeed, there are few differences with VARCHAR
: no DEFAULT
value, and, if you put an index on a TEXT
column, you must specify the prefix length, which is only optional for VARCHAR
.
精彩评论