[Commits] Rev 3578: MDEV-495 backport --ignore-db-dir

Sergei Golubchik serg at askmonty.org
Wed Sep 26 18:00:37 EEST 2012

Hi, Alexey!

> > 3. add a test for the following: lost+found is ignored, but
> >     CREATE DATABASE `lost+found` should succeed!
> >     (indeed, it creates a directory lost at 002bfound, which is not
> >     ignored), and later SELECT, CALL, USE, SHOW DATABASES,
> >     should show that new db.
> Right, i didn't think about that case.
> Fixed by adding 'tablename_to_filename' conversion.

Just one comment.

Now for every check_db_name you will do one tablename_to_filename() and
through its results away. I believe that very few users will use this
ignore-db-name feature, and very few of those who will, will choose to
ignore a name that consists only out of letters and digits.

My point is that we should not penalize the vast majority of the users,
only because few may need this tablename_to_filename().

You don't call tablename_to_filename() when ignore-db-name is not used -
which is good. But I suggest to add another check:

  * when you've building this ignore hash, try tablename_to_filename()
  for every ignored name and strcmp the converted name with the
  unconverted. Set a global flag, if they differ.

  * in db_name_is_in_ignore_db_dirs_list() you can return 0 immediately
  if this flag isn't set
  (put this instead of if (ignore_db_dirs_hash.records) check)

The idea is, that even if one would like to ignore directories, those
names will - most probably - contain '+' or '.' or some other
punctuation character. And no converted database name can ever match

> > 2. I'd prefer to get an error "db not found" instead of "incorrect db
> >     name", is it difficult to do?
> You don't mean changing the error message do you?

Okay, let's keep it your way.


More information about the commits mailing list