diff options
author | unknown <jamppa@bk-internal.mysql.com> | 2007-04-03 13:51:31 +0200 |
---|---|---|
committer | unknown <jamppa@bk-internal.mysql.com> | 2007-04-03 13:51:31 +0200 |
commit | e552b08fcd1103a0203612ad8997e1df731f5732 (patch) | |
tree | d030da595f2ef559aae694a62d6525b0d70282d4 /mysys | |
parent | 516b8b2137e27661960372c8bf5f757ffb2f2883 (diff) | |
parent | 019446f059fd04b2cc237578b944481df0f72ffa (diff) | |
download | mariadb-git-e552b08fcd1103a0203612ad8997e1df731f5732.tar.gz |
Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into bk-internal.mysql.com:/data0/bk/mysql-5.1-marvel
client/mysql.cc:
Auto merged
client/mysqlbinlog.cc:
Auto merged
sql/event_data_objects.cc:
Auto merged
sql/event_db_repository.cc:
Auto merged
sql/event_queue.cc:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
strings/ctype-utf8.c:
Auto merged
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/typelib.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysys/typelib.c b/mysys/typelib.c index 4fab6f20493..780e63b4b04 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -20,6 +20,28 @@ #include <m_ctype.h> +int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option) +{ + int res; + const char **ptr; + + if ((res= find_type((my_string) x, typelib, 2)) <= 0) + { + ptr= typelib->type_names; + if (!*x) + fprintf(stderr, "No option given to %s\n", option); + else + fprintf(stderr, "Unknown option to %s: %s\n", option, x); + fprintf(stderr, "Alternatives are: '%s'", *ptr); + while (*++ptr) + fprintf(stderr, ",'%s'", *ptr); + fprintf(stderr, "\n"); + exit(1); + } + return res; +} + + /* Search after a string in a list of strings. Endspace in x is not compared. |