+//info-------------------------------------------------------------------------
+if(!IsTablePresent("info",sock))
+{
+ sprintf(qbuf,"CREATE TABLE info (version INTEGER NOT NULL)");
+
+ if(MysqlQuery(qbuf,sock))
+ {
+ errorStr = "Couldn't create info table With error:\n";
+ errorStr += mysql_error(sock);
+ mysql_close(sock);
+ return -1;
+ }
+
+ sprintf(qbuf,"INSERT INTO info SET version=0");
+
+ if(MysqlQuery(qbuf,sock))
+ {
+ errorStr = "Couldn't write default version. With error:\n";
+ errorStr += mysql_error(sock);
+ mysql_close(sock);
+ return -1;
+ }
+ schemaVersion = 0;
+}
+else
+{
+ std::vector<std::string> info;
+ if (GetAllParams(&info, "info", "version"))
+ schemaVersion = 0;
+ else
+ {
+ if (info.empty())
+ schemaVersion = 0;
+ else
+ GetInt(info.front(), &schemaVersion, 0);
+ }
+}