Skip to content

Commit

Permalink
Fixed startup error on Fedora
Browse files Browse the repository at this point in the history
  • Loading branch information
pgulutzan committed Jun 24, 2019
1 parent 3a1e5a9 commit f8fd9d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
1 change: 1 addition & 0 deletions hparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -3840,6 +3840,7 @@ int MainWindow::hparse_f_data_type(int context)
if ((hparse_f_accept(FLAG_VERSION_MYSQL_OR_MARIADB_ALL, TOKEN_REFTYPE_ANY,TOKEN_TYPE_KEYWORD, "DECIMAL") == 1)
|| (hparse_f_accept(FLAG_VERSION_MYSQL_OR_MARIADB_ALL, TOKEN_REFTYPE_ANY,TOKEN_TYPE_KEYWORD, "DEC") == 1)
|| (hparse_f_accept(FLAG_VERSION_MYSQL_OR_MARIADB_ALL, TOKEN_REFTYPE_ANY,TOKEN_TYPE_KEYWORD, "FIXED") == 1)
|| (hparse_f_accept(FLAG_VERSION_TARANTOOL_2_2, TOKEN_REFTYPE_ANY,TOKEN_TYPE_KEYWORD, "UNSIGNED") == 1)
|| (hparse_f_accept(FLAG_VERSION_PLSQL, TOKEN_REFTYPE_ANY,TOKEN_KEYWORD_DECIMAL, "NUMBER") == 1))
{
main_token_flags[hparse_i_of_last_accepted] |= TOKEN_FLAG_IS_DATA_TYPE;
Expand Down
20 changes: 7 additions & 13 deletions ocelotgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ocelotgui -- Ocelot GUI Front End for MySQL or MariaDB

Version: 1.0.8
Last modified: May 27 2019
Last modified: June 18 2019
*/

/*
Expand Down Expand Up @@ -404,7 +404,7 @@
int options_and_connect(unsigned int connection_number, char *database_as_utf8);

/* This should correspond to the version number in the comment at the start of this program. */
static const char ocelotgui_version[]="1.0.8"; /* For --version. Make sure it's in manual too. */
static const char ocelotgui_version[]="1.0.9"; /* For --version. Make sure it's in manual too. */
unsigned short int dbms_version_mask= FLAG_VERSION_DEFAULT;

/* Global mysql definitions */
Expand Down Expand Up @@ -8707,7 +8707,6 @@ int MainWindow::action_execute_one_statement(QString text)
int additional_result= 0;
int ecs= execute_client_statement(text, &additional_result);
QString result_set_for_history= "";

if (ecs != 1)
{
/* The statement was not handled entirely by the client, it must be passed to the DBMS. */
Expand Down Expand Up @@ -10761,7 +10760,6 @@ void MainWindow::put_diagnostics_in_result(unsigned int connection_number)
float elapsed_time_as_float= (float) elapsed_time_as_long_int / 1000; /* todo: round */
sprintf(elapsed_time_string, " (%.1f seconds)", elapsed_time_as_float);
}

#ifdef DBMS_TARANTOOL
if (connections_dbms[connection_number] == DBMS_TARANTOOL)
{
Expand Down Expand Up @@ -13036,9 +13034,12 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
{
//(void) connection_number; /* suppress "unused parameter" warning */
QString ldbms_return_string;

ldbms_return_string= "";

/* Mainly we want to be sure tarantool_tnt_reply.data == 0 if failure */
/* tnt_reply_init() also does memset but it might not be available yet */
memset(&tarantool_tnt_reply, 0, sizeof(struct tnt_reply));

/* Find libtarantool. Prefer ld_run_path. */
if (is_libtarantool_loaded != 1)
{
Expand All @@ -13048,7 +13049,6 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
{
lmysql->ldbms_get_library("", &is_libtarantool_loaded, &libtarantool_handle, &ldbms_return_string, WHICH_LIBRARY_LIBTARANTOOL);
}

/* Find libtarantoolnet. Prefer ld_run_path. */
/* Now libtarantool.so has everything so this is removed. */
//if (is_libtarantoolnet_loaded != 1)
Expand Down Expand Up @@ -13088,7 +13088,6 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
delete lmysql;
return 1;
}

/* Todo: this should have been done already; we must be calling from the wrong place. */
copy_connect_strings_to_utf8();

Expand Down Expand Up @@ -13157,7 +13156,6 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
strcpy(tarantool_errmsg, er_strings[er_off + ER_OK]);
}
}

if (tarantool_errno[connection_number] != 0)
{
/* Kludge so put_diagnostics_in_result won't crash */
Expand All @@ -13175,7 +13173,6 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
}
make_and_put_message_in_result(ER_OK, 0, (char*)"");
connections_is_connected[connection_number]= 1;

QString session_id, version;
{
char query_string[1024];
Expand All @@ -13192,7 +13189,6 @@ int MainWindow::connect_tarantool(unsigned int connection_number,
/* The caller should save the connection for the server id. */
return 0;
}

sql_mode_ansi_quotes= true; /* see comment = ansi_quotes */
hparse_sql_mode_ansi_quotes= true; /* probably not necessary */

Expand Down Expand Up @@ -13615,7 +13611,7 @@ int MainWindow::get_statement_type_low(QString word0, QString word1, QString wor
calculate for both SQL table and NoSQL space, make sure it's not
in a transaction so it will really produce a grid result.
Put it in global or (somehow) add to the result set information.
But this is deferred because Tarantool is revising box.execute.
Tarantool has revised box.execute() but I still mostly follow the old way.
! You won't see TOKEN_REFTYPE_COLUMN if it is *
! dbms_query might be only the current query of a multi-query
this is a shame because when you call action_execute_one_statement you have text
Expand Down Expand Up @@ -14067,7 +14063,6 @@ QString MainWindow::tarantool_get_messages(int connection_number)
messages.append(tarantool_errmsg);
return messages;
}

const char *tarantool_tnt_reply_data_copy= tarantool_tnt_reply.data;

if (tarantool_errno[connection_number] == 0)
Expand Down Expand Up @@ -17967,7 +17962,6 @@ void MainWindow::connect_make_statement()
/* Todo: QMessageBox should have a parent, use "= new" */
QMessageBox msgBox;
QString statement_text;

statement_text= "CONNECT";
if (ocelot_defaults_file > "") statement_text= statement_text + " defaults_file=" + ocelot_defaults_file;
if (ocelot_no_defaults > 0) statement_text= statement_text + " no_defaults";
Expand Down
2 changes: 1 addition & 1 deletion ocelotgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -2410,7 +2410,7 @@ static const keywords strvalues[]=
{"UNIX_TIMESTAMP", 0, FLAG_VERSION_MYSQL_OR_MARIADB_ALL, TOKEN_KEYWORD_UNIX_TIMESTAMP},
{"UNKNOWN", FLAG_VERSION_TARANTOOL, 0, TOKEN_KEYWORD_UNKNOWN},
{"UNLOCK", FLAG_VERSION_MYSQL_OR_MARIADB_ALL, 0, TOKEN_KEYWORD_UNLOCK},
{"UNSIGNED", FLAG_VERSION_MYSQL_OR_MARIADB_ALL, 0, TOKEN_KEYWORD_UNSIGNED},
{"UNSIGNED", FLAG_VERSION_MYSQL_OR_MARIADB_ALL | FLAG_VERSION_TARANTOOL_2_2, 0, TOKEN_KEYWORD_UNSIGNED},
{"UNTIL", FLAG_VERSION_LUA, 0, TOKEN_KEYWORD_UNTIL},
{"UPDATE", FLAG_VERSION_ALL, 0, TOKEN_KEYWORD_UPDATE},
{"UPDATEXML", 0, FLAG_VERSION_MYSQL_OR_MARIADB_ALL, TOKEN_KEYWORD_UPDATEXML},
Expand Down

0 comments on commit f8fd9d4

Please sign in to comment.