IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 38976


Ignore:
Timestamp:
Oct 27, 2015, 3:24:11 PM (11 years ago)
Author:
eugene
Message:

protect special names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20150625/Ohana/src/tools/src/fits_to_mysql.c

    r38975 r38976  
    230230    gfits_scan (header, field, "%s", 1, format);
    231231
     232    // some special names must be protected:
     233    if (!strcasecmp (tlabel, "index")) { strcpy (tlabel, "index_"); }
     234    if (!strcasecmp (tlabel, "table")) { strcpy (tlabel, "table_"); }
     235
    232236    // check for duplicates
    233237    int Ndup = 0;
     
    299303  char *tablename = strcreate (extname);
    300304  replace_dot_with_underscore (tablename);
     305
     306  // some special names must be protected:
     307  if (!strcasecmp (tablename, "index")) {
     308    free (tablename);
     309    tablename = strcreate ("index_");
     310  }
     311  if (!strcasecmp (tablename, "table")) {
     312    free (tablename);
     313    tablename = strcreate ("table_");
     314  }
    301315
    302316  // drop the table if it exists
Note: See TracChangeset for help on using the changeset viewer.