0

I'm using MariaDB and I have a sql file which looks like this:

create table table1(
     id int auto_increment primary key,
     name varchar(50))
);
drop index if exists my_index on table1;
create fulltext index my_index on table1(name);

When i run this file with source file.sql it generates this warning:

+-------+------+--------------------------------------------------------------------------+
| Level | Code | Message                                                                  |
+-------+------+--------------------------------------------------------------------------+
| Note  | 1091 | Can't DROP 'my_index'; check that column/key exists                      |
+-------+------+--------------------------------------------------------------------------+

Is there a way to take this warning away?

3
  • nome !== name Commented Jan 3, 2020 at 13:27
  • sorry, missclick @RiggsFolly Commented Jan 3, 2020 at 13:32
  • Well, it works without error in this db<>fiddle test here. So I guess you just don't want the warning. Commented Jan 3, 2020 at 13:45

1 Answer 1

2

This is what I have founded here: https://mariadb.com/kb/en/drop-index/

If the IF EXISTS clause is used, then MariaDB will return a warning instead of an error if the index does not exist.

Hope this helps.

Sign up to request clarification or add additional context in comments.

2 Comments

so in other words, is nothing to care about
Well, yes, but I am checking to see how to resolve this: "Is there a way to take this warning away?" There is a table : mariadb.com/kb/en/information-schema-index_statistics-table that you can query and check if the index exists. And then if it exists drop it and if not...but I can not run it on dbfiddle.uk/?rdbms=mariadb_10.4 to test that... sorry. Maybe this comment will also be of some help...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.