Fossil

Check-in [b408ece7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Set binary translation mode on windows for import and export. Ticket [feeb8a91eb838f743ae9]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b408ece7f603de55b73e6a9711384cbb1c715e11
User & Date: drh 2010-11-17 13:15:14
Context
2010-11-17
13:38
Tweaks to the graph layout. Add a graph to ticket timelines. check-in: cf178577 user: drh tags: trunk, release
13:15
Set binary translation mode on windows for import and export. Ticket [feeb8a91eb838f743ae9] check-in: b408ece7 user: drh tags: trunk
2010-11-16
23:16
Update to the latest version of SQLite with the sqlite3_stmt_readonly() capability and use that interface for additional security of the user-entered SQL in the ticket report logic. check-in: 115f3ea6 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/export.c.

103
104
105
106
107
108
109

110
111
112
113
114
115
116
  bag_init(&vers);

  db_find_and_open_repository(1);

  /* Step 1:  Generate "blob" records for every artifact that is part
  ** of a check-in 
  */

  db_prepare(&q, "SELECT DISTINCT fid FROM mlink WHERE fid>0");
  while( db_step(&q)==SQLITE_ROW ){
    int rid = db_column_int(&q, 0);
    Blob content;
    content_get(rid, &content);
    printf("blob\nmark :%d\ndata %d\n", rid, blob_size(&content));
    bag_insert(&blobs, rid);







>







103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
  bag_init(&vers);

  db_find_and_open_repository(1);

  /* Step 1:  Generate "blob" records for every artifact that is part
  ** of a check-in 
  */
  fossil_binary_mode(stdout);
  db_prepare(&q, "SELECT DISTINCT fid FROM mlink WHERE fid>0");
  while( db_step(&q)==SQLITE_ROW ){
    int rid = db_column_int(&q, 0);
    Blob content;
    content_get(rid, &content);
    printf("blob\nmark :%d\ndata %d\n", rid, blob_size(&content));
    bag_insert(&blobs, rid);

Changes to src/import.c.

591
592
593
594
595
596
597

598
599
600
601
602
603
604
  if( g.argc!=3  && g.argc!=4 ){
    usage("REPOSITORY-NAME");
  }
  if( g.argc==4 ){
    pIn = fopen(g.argv[3], "rb");
  }else{
    pIn = stdin;

  }
  if( forceFlag ) unlink(g.argv[2]);
  db_create_repository(g.argv[2]);
  db_open_repository(g.argv[2]);
  db_open_config(0);
  db_multi_exec(
     "CREATE TEMP TABLE xtag(tname TEXT UNIQUE, trid INT, tuuid TEXT);"







>







591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
  if( g.argc!=3  && g.argc!=4 ){
    usage("REPOSITORY-NAME");
  }
  if( g.argc==4 ){
    pIn = fopen(g.argv[3], "rb");
  }else{
    pIn = stdin;
    fossil_binary_mode(pIn);
  }
  if( forceFlag ) unlink(g.argv[2]);
  db_create_repository(g.argv[2]);
  db_open_repository(g.argv[2]);
  db_open_config(0);
  db_multi_exec(
     "CREATE TEMP TABLE xtag(tname TEXT UNIQUE, trid INT, tuuid TEXT);"

Changes to src/main.c.

405
406
407
408
409
410
411










412
413
414
415
416
417
418
#else
  /* On unix, evaluate the command directly.
  */
  rc = system(zOrigCmd);
#endif 
  return rc; 
}













/*
** Return a name for an SQLite error code
*/
static const char *sqlite_error_code_name(int iCode){







>
>
>
>
>
>
>
>
>
>







405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
#else
  /* On unix, evaluate the command directly.
  */
  rc = system(zOrigCmd);
#endif 
  return rc; 
}

/*
** Turn off any NL to CRNL translation on the stream given as an
** argument.  This is a no-op on unix but is necessary on windows.
*/
void fossil_binary_mode(FILE *p){
#if defined(_WIN32)
  _setmode(_fileno(p), _O_BINARY);
#endif
}



/*
** Return a name for an SQLite error code
*/
static const char *sqlite_error_code_name(int iCode){