sqldata/sqldb.cpp
// Add table options when target is MySQL
Add table options when target is MySQL
Add table options when target is MySQL
void SqlDb::AddMySQLTableOptions(const char *s_table, std::string &sql)
{
	std::string comment;
	_source_ca.db_api->GetComment(s_table, NULL, comment);
	if(comment.empty() == false)
	{
		std::string quoted_comment;
		Str::Quote(comment, quoted_comment);
		sql += "\n  COMMENT ";
		sql += quoted_comment;
	}
	const char *value = _parameters->Get("-mysql_set_character_set");
	if(Str::IsSet(value))
	{
		sql += "\n  CHARACTER SET ";
		sql += value;
	}
	value = _parameters->Get("-mysql_set_collation");
	if(Str::IsSet(value))
	{
		sql += "\n  COLLATE ";
		sql += value;
	}
}
void SqlDb :: AddMySQLTableOptions ( const char * s_table , std :: string & sql ) { std :: string comment ; _source_ca . db_api -> GetComment ( s_table , NULL , comment ) ; if ( comment . empty ( ) == false ) { std :: string quoted_comment ; Str :: Quote ( comment , quoted_comment ) ; sql += " \n " ; sql += quoted_comment ; } const char * value = _parameters -> Get ( " " ) ; if ( Str :: IsSet ( value ) ) { sql += " \n " ; sql += value ; } value = _parameters -> Get ( " " ) ; if ( Str :: IsSet ( value ) ) { sql += " \n " ; sql += value ; } }
Add table options when target is MySQL
Add table options when target is MySQL
// Add table comment as a part of CREATE TABLE statement // A comment found // Single quotes in comment must be duplicated // Character set // Collation