Type:
Bug
Priority:
Major
Resolution:
Fixed
Affects Version/s:
N/A
MDEV-12459 introduced a note upon creation of a temporary table which shadows an existing base table; it looks quite natural.
However, this note is also produced upon ALTER of such a table. That is not natural, even though may be understandable from the technical point of view.
create table t (a int );
create temporary table t (b int );
alter table t add c int ;
# Cleanup
drop temporary table t;
drop table t;
preview-10.9-MDEV-20119-misc c906db30
alter table t add c int ;
Warnings:
Note 1050 Table 't' already exists
is caused by
MDEV-12459
The information_schema tables for getting temporary tables info is missing, at least for innodb there is no INNODB_TEMP_TABLE_INFO
Closed
Anel Husakovic
made changes -
2022-04-18 11:03
Status
Open
[ 1
]
In Progress
[ 3
]
Anel Husakovic
made changes -
2022-04-20 10:06
Assignee
Anel Husakovic
[ anel
]
Michael Widenius
[ monty
]
Status
In Progress
[ 3
]
In Review
[ 10002
]
Michael Widenius
made changes -
2022-04-20 10:32
Status
In Review
[ 10002
]
Stalled
[ 10000
]
Michael Widenius
made changes -
2022-04-20 10:32
Assignee
Michael Widenius
[ monty
]
Anel Husakovic
[ anel
]
Anel Husakovic
made changes -
2022-04-27 13:47
Assignee
Anel Husakovic
[ anel
]
Michael Widenius
[ monty
]
Status
Stalled
[ 10000
]
In Review
[ 10002
]
Anel Husakovic
made changes -
2023-04-03 08:39
Assignee
Michael Widenius
[ monty
]
Vicențiu Ciorbaru
[ cvicentiu
]
Sergei Golubchik
made changes -
2023-08-12 13:47
Fix Version/s
11.2.1
[ 29034
]
Fix Version/s
10.9
[ 26905
]
Assignee
Vicențiu Ciorbaru
[ cvicentiu
]
Anel Husakovic
[ anel
]
Resolution
Fixed
[ 1
]
Status
In Review
[ 10002
]
Closed
[ 6
]
{"report":{"fcp":1252.3999999761581,"ttfb":321.1999999284744,"pageVisibility":"visible","entityId":110019,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"e9001896-5ec3-4541-a3d0-44d2b49ae3cb","navigationType":0,"readyForUser":1327.5999999046326,"redirectCount":0,"resourceLoadedEnd":1509.8999999761581,"resourceLoadedStart":327.6999999284744,"resourceTiming":[{"duration":408.3000000715256,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":327.6999999284744,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":327.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":736,"responseStart":0,"secureConnectionStart":0},{"duration":408.39999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":328,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":328,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":736.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":461.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":328.09999990463257,"connectEnd":328.09999990463257,"connectStart":328.09999990463257,"domainLookupEnd":328.09999990463257,"domainLookupStart":328.09999990463257,"fetchStart":328.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":328.09999990463257,"responseEnd":789.5,"responseStart":789.5,"secureConnectionStart":328.09999990463257},{"duration":509.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":328.39999997615814,"connectEnd":328.39999997615814,"connectStart":328.39999997615814,"domainLookupEnd":328.39999997615814,"domainLookupStart":328.39999997615814,"fetchStart":328.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":328.39999997615814,"responseEnd":837.5,"responseStart":837.5,"secureConnectionStart":328.39999997615814},{"duration":512.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":328.59999990463257,"connectEnd":328.59999990463257,"connectStart":328.59999990463257,"domainLookupEnd":328.59999990463257,"domainLookupStart":328.59999990463257,"fetchStart":328.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":328.59999990463257,"responseEnd":841.2999999523163,"responseStart":841.2999999523163,"secureConnectionStart":328.59999990463257},{"duration":513,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":328.7999999523163,"connectEnd":328.7999999523163,"connectStart":328.7999999523163,"domainLookupEnd":328.7999999523163,"domainLookupStart":328.7999999523163,"fetchStart":328.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":328.7999999523163,"responseEnd":841.7999999523163,"responseStart":841.7999999523163,"secureConnectionStart":328.7999999523163},{"duration":513.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":329,"connectEnd":329,"connectStart":329,"domainLookupEnd":329,"domainLookupStart":329,"fetchStart":329,"redirectEnd":0,"redirectStart":0,"requestStart":329,"responseEnd":842.0999999046326,"responseStart":842.0999999046326,"secureConnectionStart":329},{"duration":603.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":329.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":329.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":932.2999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":513.2999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":329.2999999523163,"connectEnd":329.2999999523163,"connectStart":329.2999999523163,"domainLookupEnd":329.2999999523163,"domainLookupStart":329.2999999523163,"fetchStart":329.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":329.2999999523163,"responseEnd":842.5999999046326,"responseStart":842.5999999046326,"secureConnectionStart":329.2999999523163},{"duration":602.8999999761581,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":329.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":329.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":932.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":513.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":329.59999990463257,"connectEnd":329.59999990463257,"connectStart":329.59999990463257,"domainLookupEnd":329.59999990463257,"domainLookupStart":329.59999990463257,"fetchStart":329.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":329.59999990463257,"responseEnd":843.0999999046326,"responseStart":843.0999999046326,"secureConnectionStart":329.59999990463257},{"duration":1167.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":330.59999990463257,"connectEnd":330.59999990463257,"connectStart":330.59999990463257,"domainLookupEnd":330.59999990463257,"domainLookupStart":330.59999990463257,"fetchStart":330.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":330.59999990463257,"responseEnd":1498.3999999761581,"responseStart":1498.3999999761581,"secureConnectionStart":330.59999990463257},{"duration":1168.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":330.6999999284744,"connectEnd":330.6999999284744,"connectStart":330.6999999284744,"domainLookupEnd":330.6999999284744,"domainLookupStart":330.6999999284744,"fetchStart":330.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":330.6999999284744,"responseEnd":1498.8999999761581,"responseStart":1498.8999999761581,"secureConnectionStart":330.6999999284744},{"duration":179.60000002384186,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":943.6999999284744,"connectEnd":943.6999999284744,"connectStart":943.6999999284744,"domainLookupEnd":943.6999999284744,"domainLookupStart":943.6999999284744,"fetchStart":943.6999999284744,"redirectEnd":0,"redirectStart":0,"requestStart":943.6999999284744,"responseEnd":1123.2999999523163,"responseStart":1123.2999999523163,"secureConnectionStart":943.6999999284744},{"duration":294.60000002384186,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1204.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1204.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1499.1999999284744,"responseStart":0,"secureConnectionStart":0},{"duration":294.3000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1205.5999999046326,"connectEnd":1205.5999999046326,"connectStart":1205.5999999046326,"domainLookupEnd":1205.5999999046326,"domainLookupStart":1205.5999999046326,"fetchStart":1205.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1205.5999999046326,"responseEnd":1499.8999999761581,"responseStart":1499.8999999761581,"secureConnectionStart":1205.5999999046326},{"duration":296.09999990463257,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1246.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1246.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1542.5999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":303.8000000715256,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1206.0999999046326,"connectEnd":1206.0999999046326,"connectStart":1206.0999999046326,"domainLookupEnd":1206.0999999046326,"domainLookupStart":1206.0999999046326,"fetchStart":1206.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1206.0999999046326,"responseEnd":1509.8999999761581,"responseStart":1509.8999999761581,"secureConnectionStart":1206.0999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":126,"responseStart":322,"responseEnd":325,"domLoading":325,"domInteractive":1547,"domContentLoadedEventStart":1547,"domContentLoadedEventEnd":1597,"domComplete":2122,"loadEventStart":2122,"loadEventEnd":2122,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1508.8999999761581},{"name":"bigPipe.sidebar-id.end","time":1509.6999999284744},{"name":"bigPipe.activity-panel-pipe-id.start","time":1509.8999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1515.6999999284744},{"name":"activityTabFullyLoaded","time":1615.5}],"measures":[],"correlationId":"f4afef2f171c95","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":133,"dbReadsTimeInMs":23,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 11d1a739eb2..561aaa3d46a 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -5803,9 +5803,9 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
/**
@brief Fill IS.table with temporary tables
+ @param[in] thd thread handle
@param[in] table I_S table (TABLE)
- @param[in] db_name db name of temporary table
- @param[in] table_name table name of temporary table
+ @param[in] table_name temporary table
@return Operation status
@retval 0 - success
@retval 1 - failure
The above doesn't match the function parameters:
void process_i_s_table_temporary_tables(THD *thd, TABLE * table, TABLE *tmp_tbl)
Please update.
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index f52733c2640..9315ef06e90 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4369,6 +4369,9 @@ int create_table_impl(THD *thd,
#else
warning_given=1;
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
+ if (create_table_mode == C_ALTER_TABLE_FRM_ONLY || create_table_mode == C_ALTER_TABLE)
+ warning_given= 0;
+
if (warning_given)
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR,
In the code you are first setting warning_given and then reseting it.
Better to not set warning_given at all.
An alternative patch is:
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 9315ef06e90..79c8a946487 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -4357,26 +4357,28 @@ int create_table_impl(THD *thd,
ddl_log_state_create= 0;
ddl_log_state_rm= 0;
- if (ha_table_exists(thd, &orig_db, &orig_table_name, NULL, NULL, NULL))
+ if (create_table_mode != C_ALTER_TABLE_FRM_ONLY &&
+ create_table_mode != C_ALTER_TABLE)
{
+ if (ha_table_exists(thd, &orig_db, &orig_table_name, NULL, NULL, NULL))
+ {
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- TABLE_LIST table_acl_check;
- bzero((char*) &table_acl_check, sizeof(table_acl_check));
- table_acl_check.db= orig_db;
- table_acl_check.table_name= orig_table_name;
- if (!check_table_access(thd, TABLE_ACLS, &table_acl_check, true, 1, true))
- warning_given= 1;
+ TABLE_LIST table_acl_check;
+ bzero((char*) &table_acl_check, sizeof(table_acl_check));
+ table_acl_check.db= orig_db;
+ table_acl_check.table_name= orig_table_name;
+ if (!check_table_access(thd, TABLE_ACLS, &table_acl_check, true, 1, true))
+ warning_given= 1;
#else
- warning_given=1;
+ warning_given=1;
#endif /* NO_EMBEDDED_ACCESS_CHECKS */
- if (create_table_mode == C_ALTER_TABLE_FRM_ONLY || create_table_mode == C_ALTER_TABLE)
- warning_given= 0;
- if (warning_given)
+ if (warning_given)
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_TABLE_EXISTS_ERROR,
ER_THD(thd, ER_TABLE_EXISTS_ERROR),
orig_table_name.str);
+ }
}