Changeset 38977
- Timestamp:
- Oct 27, 2015, 3:54:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20150625/Ohana/src/tools/src/fits_to_mysql.c
r38976 r38977 51 51 char *DATABASE_PASS; 52 52 char *DATABASE_NAME; 53 char *TABLENAME; 53 54 54 55 int args (int *argc, char **argv); … … 94 95 95 96 int Nsection = 0; 97 int Ntable = 0; 96 98 while (gfits_fread_header (f, &header)) { 97 99 … … 143 145 InitIOBuffer (&insert, 1024); 144 146 147 if ((Ntable > 0) && TABLENAME) { 148 fprintf (stderr, "WARNING: table name is supplied but more than one table is read: earlier tables will be replaced\n"); 149 } 145 150 create_table (columns, Ncolumns, extname, &insert, mysqlReal); 146 151 … … 174 179 fseeko (f, Nbytes, SEEK_CUR); 175 180 Nsection ++; 181 Ntable ++; 176 182 177 183 FreeColumnDef (columns, Ncolumns); … … 186 192 FREE (DATABASE_PASS); 187 193 FREE (DATABASE_NAME); 194 FREE (TABLENAME); 188 195 189 196 ohana_memdump (TRUE); … … 301 308 InitIOBuffer (&buffer, 1024); 302 309 303 char *tablename = strcreate (extname);310 char *tablename = TABLENAME ? strcreate (TABLENAME) : strcreate (extname); 304 311 replace_dot_with_underscore (tablename); 305 312 … … 688 695 } else usage(); 689 696 697 TABLENAME = NULL; 698 if ((N = get_argument (*argc, argv, "-tablename"))) { 699 remove_argument (N, argc, argv); 700 TABLENAME = strcreate (argv[N]); 701 remove_argument (N, argc, argv); 702 } 703 690 704 return TRUE; 691 705 }
Note:
See TracChangeset
for help on using the changeset viewer.
