1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Paste corruption

Discussion in 'Support' started by jabelli, Jul 5, 2012.

  1. jabelli

    jabelli

    Messages:
    80
    Copy this line:
    SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT
    (including the EOL) and paste it into notepad 100 times. Copy all 100 lines. In TCMD, type "copy con foo" and press enter. Right-click and select paste. Press ^Z and press enter. Type "VIEW foo" and press enter. Examine the output.

    Expected: SELECT repeated 1100 times, 11 per line.

    Actual: SELECT appears 1097 times, plus one SELEST, one SSLECT, and one SELECS. The first error is at byte 2075 (line 27), the next is 2075 after that (line 54), and the third is 2074 after that (line 80) (by VIEW report of selection).

    Detach the tab and repeat the test, and you get the expected result.

    TCC 14.00.26 x64 Windows 7 [Version 6.1.7601]
    TCC Build 26 Windows 7 Build 7601 Service Pack 1

    and

    TCC 13.04.63 x64 Windows 7 [Version 6.1.7601]
    TCC Build 63 Windows 7 Build 7601 Service Pack 1
  2. vefatica

    vefatica

    Messages:
    5,055
    I see it too, exactly as described. It does not happen in a console.

    It's easier to get started with

    Code:
    do i=1 to 100 (echo SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT SELECT >> v:\select.txt)
    notepad select.exe
  3. jabelli

    jabelli

    Messages:
    80
    OK, so now I don’t see the problem when doing COPY CON. I’m still getting the problem when pasting into an external program.

    Example: download sqlite3 shell
    Start sqlite3.exe in a TCC shell in a TCMD window. Paste the following text:
    Code:
    DROP TABLE IF EXISTS TestTable;
    CREATE TABLE TestTable (a, b, c, d);
    INSERT INTO TestTable
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
    SELECT 'foo', 'bar', 'baz', 9001;
     
    
    What I’m seeing is that every time I paste, I’m getting an ‘IJ’ ligature (IJ, U+0132) on the next input line. Sometimes, the paste is still corrupted, but now it’s in random places:
    Code:
    SQLite version 3.7.13 2012-06-11 02:05:22
    Enter ".help" for instructions
    Enter SQL statements terminated with a ";"
    sqlite> DROP TABLE IF EXISTS TestTable;
    sqlite> CREATE TABLE TestTable (a, b, c, d);
    sqlite> INSERT INTO TestTable
      ...> SELECT 'fo', 'bar', 'baz', 901 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001 UNION ALL
      ...> SELECT 'foo', 'bar', 'baz', 9001;
    sqlite>
    sqlite> IJ
    Again, none of this happens in a detached TCC.

    EDIT: I have been using sqlite3 shell to test my SQL before putting it in a program for years now, and I only noticed this problem in the last week. I re-installed TCMD 12 and I see the problem there too, so either v12 is loading a dll installed with v14, or a recent Windows Update is responsible for this.
  4. jabelli

    jabelli

    Messages:
    80
    Sorry, still getting the problem in .28.

    What I do notice is that in both .27 and .28, the omissions are where there are multiples of the same character, one is omitted. Also, it happens less frequently the more times you paste, until you restart the program (sqlite3, in this case)

    Using
    Code:
    DROP TABLE IF EXISTS TestTable; -- commment
    CREATE TABLE TestTable (a, b, c, d); -- commment
    INSERT INTO TestTable -- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
    SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001; --- commment
     
    
    and a newly started sqlite3, I got:
    Code:
    sqlite> DROP TABLE IF EXISTS TestTable; -- commment
    sqlite> CREATE TABLE TestTable (a, b, c, d); - coment
      ...> INSERT INTO TestTable -- commment
      ...> SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
      ...> SELECT 'fo', 'bar', 'baz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001 UNION ALL --- commment
      ...> SELECT 'fooo', 'bar', 'baaaaaaaaaaaz', 90000001; --- commment
    Error: near "-": syntax error
  5. JohnQSmith

    JohnQSmith

    Messages:
    445
    Another sample that drops even more duplicate characters using jabelli's sample text from above...
    Code:
    C:\temp> edlin test.txt
    New file
    *i
          1:*DROP TABLE IF EXISTS TestTable; - coment
          2:*CREATE TABLE TestTable (a, b, c, d); - coment
          3:*INSERT INTO TestTable - coment
          4:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          5:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          6:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          7:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          8:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          9:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          10:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          11:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          12:*SELECT 'fo', 'bar', 'baz', 901 UNION AL - coment
          13:*SELECT 'fo', 'bar', 'baz', 901; - coment
          14:*^C
     
    *q
    Abort edit (Y/N)? y
    C:\temp>
  6. rconn

    rconn Administrator Staff Member

    Messages:
    6,704
    This should be fixed in build 29. (It is a Windows console API bug, and not directly related to the fix in build 28.)
  7. jabelli

    jabelli

    Messages:
    80
    Thanks, all fixed now. I can test my SQLite SQL without having to mess around with the tabs.

Share This Page