outputting varchars to a file to be read by load data infile
Zardosht Kasheff <[email protected]> Sun, 5 May 2013 11:53:57 -0400
| Newsgroups | gmane.comp.db.mysql.devel |
|---|---|
| Message-ID | <CABFd+SGeynrS7J8z5u2EZXnnOBdcrqf1rb6qtyYWJW+gsEcGGw@mail.gmail.com> |
Hello all, I have an interesting problem. I am in the process of trying to manually recover data from a corrupted dictionary. The table has DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci, and there are four columns: `a` varchar(100) CHARACTER SET utf8 NOT NULL, `b` varchar(10) COLLATE latin1_general_ci DEFAULT NULL, `c` varchar(20) COLLATE latin1_general_ci DEFAULT NULL, `d` varchar(20) COLLATE latin1_general_ci NOT NULL DEFAULT '', The data in the corrupted dictionary is identical to what we would find in table->record[0] as accessed by storage engine's handler. It contains the length of each string and the bytes. What I want to do is make a little program that will read this data from the corrupted dictionary, and write it to a file in such a format such that I can use "load data infile" to interpret it correctly and reload the data. If I just copy the bytes directly to the file, will load data infile be able to interpret the data? Is there anything else that needs to be done (such as put in a \0 or something?) Thanks -Zardosht -- MySQL Internals Mailing List For list archives: http://lists.mysql.com/internals To unsubscribe: http://lists.mysql.com/internals