"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gb.db.mysql/src/main.c" between
gambas-3.16.2.tar.bz2 and gambas-3.16.3.tar.bz2

About: Gambas is a graphical development environment based on a Basic interpreter with object extensions, a bit like Visual Basic (requires Qt).

main.c  (gambas-3.16.2.tar.bz2):main.c  (gambas-3.16.3.tar.bz2)
skipping to change at line 727 skipping to change at line 727
fprintf(stderr, "WARNING: Unable to set database charset to UTF-8 \n"); fprintf(stderr, "WARNING: Unable to set database charset to UTF-8 \n");
// GB.FreeString(&db_charset); // GB.FreeString(&db_charset);
if (do_query(db, "Unable to get database charset: &1", &res, "show variab les like 'character_set_client'", 0)) if (do_query(db, "Unable to get database charset: &1", &res, "show variab les like 'character_set_client'", 0))
return; return;
if (search_result(res, "character_set_client", &row)) if (search_result(res, "character_set_client", &row))
return; return;
db->charset = GB.NewZeroString(row[1]); if (strncasecmp(row[1], "utf8", 4) == 0)
db->charset = GB.NewString("utf8", 4);
else
db->charset = GB.NewZeroString(row[1]);
//fprintf(stderr, "charset is '%s'\n", db->charset); //fprintf(stderr, "charset is '%s'\n", db->charset);
mysql_free_result(res); mysql_free_result(res);
} }
static int open_database(DB_DESC *desc, DB_DATABASE *db) static int open_database(DB_DESC *desc, DB_DATABASE *db)
{ {
MYSQL *conn; MYSQL *conn;
char *name; char *name;
char *host; char *host;
char *socket; char *socket;
skipping to change at line 1776 skipping to change at line 1779
} }
DB.Query.Add(" CHARACTER SET "); DB.Query.Add(" CHARACTER SET ");
DB.Query.AddLength(fp->collation, p - fp->collati on); DB.Query.AddLength(fp->collation, p - fp->collati on);
DB.Query.Add(" COLLATE "); DB.Query.Add(" COLLATE ");
DB.Query.Add(fp->collation); DB.Query.Add(fp->collation);
} }
if (fp->def.type != GB_T_NULL) if (fp->def.type != GB_T_NULL)
{ {
DB.Query.Add(" NOT NULL DEFAULT"); DB.Query.Add(" NOT NULL DEFAULT ");
DB.FormatVariant(&_driver, &fp->def, DB.Query.Add Length); DB.FormatVariant(&_driver, &fp->def, DB.Query.Add Length);
} }
else if (DB.StringArray.Find(primary, fp->name) >= 0) else if (DB.StringArray.Find(primary, fp->name) >= 0)
{ {
DB.Query.Add(" NOT NULL"); DB.Query.Add(" NOT NULL");
} }
} }
} }
if (primary) if (primary)
 End of changes. 2 change blocks. 
2 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)