code: func (e *ShowExec) fetchShowCreateDatabase() error {
  	checker := privilege.GetPrivilegeManager(e.ctx)
  	if checker != nil && e.ctx.GetSessionVars().User != nil && !checker.DBIsVisible(fmt.Sprint(e.DBName)) {
  		return e.dbAccessDenied()
  	}
  	db, ok := e.is.SchemaByName(e.DBName)
  	if !ok {
  		return infoschema.ErrDatabaseNotExists.GenWithStackByArgs(e.DBName.O)
  	}
  
  	sqlMode := e.ctx.GetSessionVars().SQLMode
  
  	var buf bytes.Buffer
  	var ifNotExists string
  	if e.IfNotExists {
  		ifNotExists = "/*!32312 IF NOT EXISTS*/ "
  	}
  	fmt.Fprintf(&buf, "CREATE DATABASE %s%s", ifNotExists, escape(db.Name, sqlMode))
  	if s := db.Charset; len(s) > 0 {
  		fmt.Fprintf(&buf, " /*!40100 DEFAULT CHARACTER SET %s */", s)
  	}
  
  	e.appendRow([]interface{}{db.Name.O, buf.String()})
  	return nil
  }
docs: // fetchShowCreateDatabase composes show create database result.