summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc30
1 files changed, 18 insertions, 12 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 85889b614c8..d290fde9d22 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1174,7 +1174,8 @@ public:
my_snprintf(m_view_access_denied_message, MYSQL_ERRMSG_SIZE,
ER_THD(thd, ER_TABLEACCESS_DENIED_ERROR), "SHOW VIEW",
m_sctx->priv_user,
- m_sctx->host_or_ip, m_top_view->get_table_name());
+ m_sctx->host_or_ip,
+ m_top_view->get_db_name(), m_top_view->get_table_name());
}
return m_view_access_denied_message_ptr;
}
@@ -1266,7 +1267,8 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
DBUG_PRINT("debug", ("check_table_access failed"));
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
"SHOW", thd->security_ctx->priv_user,
- thd->security_ctx->host_or_ip, table_list->alias.str);
+ thd->security_ctx->host_or_ip,
+ table_list->db.str, table_list->alias.str);
goto exit;
}
DBUG_PRINT("debug", ("check_table_access succeeded"));
@@ -1295,7 +1297,8 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
{
my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
"SHOW", thd->security_ctx->priv_user,
- thd->security_ctx->host_or_ip, table_list->alias.str);
+ thd->security_ctx->host_or_ip,
+ table_list->db.str, table_list->alias.str);
goto exit;
}
}
@@ -7163,13 +7166,14 @@ static bool store_trigger(THD *thd, Trigger *trigger,
table->field[14]->store(STRING_WITH_LEN("OLD"), cs);
table->field[15]->store(STRING_WITH_LEN("NEW"), cs);
- if (trigger->create_time)
+ if (trigger->hr_create_time.val)
{
+ /* timestamp is in microseconds */
table->field[16]->set_notnull();
- thd->variables.time_zone->gmt_sec_to_TIME(&timestamp,
- (my_time_t)(trigger->create_time/100));
- /* timestamp is with 6 digits */
- timestamp.second_part= (trigger->create_time % 100) * 10000;
+ thd->variables.time_zone->
+ gmt_sec_to_TIME(&timestamp,
+ (my_time_t) hrtime_to_time(trigger->hr_create_time));
+ timestamp.second_part= hrtime_sec_part(trigger->hr_create_time);
table->field[16]->store_time_dec(&timestamp, 2);
}
@@ -10343,12 +10347,14 @@ static bool show_create_trigger_impl(THD *thd, Trigger *trigger)
trigger->db_cl_name.length,
system_charset_info);
- if (trigger->create_time)
+ if (trigger->hr_create_time.val)
{
MYSQL_TIME timestamp;
- thd->variables.time_zone->gmt_sec_to_TIME(&timestamp,
- (my_time_t)(trigger->create_time/100));
- timestamp.second_part= (trigger->create_time % 100) * 10000;
+ thd->variables.time_zone->
+ gmt_sec_to_TIME(&timestamp,
+ (my_time_t)
+ hrtime_to_time(trigger->hr_create_time));
+ timestamp.second_part= hrtime_sec_part(trigger->hr_create_time);
p->store(&timestamp, 2);
}
else