-
Bug
-
-
Major
-
Resolution:
Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
-
-
I create a table and a VIEW on in:
CREATE OR REPLACE TABLE t1 (
|
i1 INT NOT NULL DEFAULT 0,
|
i3 BIGINT UNSIGNED NOT NULL DEFAULT 0xFFFFFFFFFFFFFFFF,
|
s1 VARCHAR(10) CHARACTER SET latin1 NOT NULL DEFAULT 's1def',
|
d1 DECIMAL(31,1) NOT NULL DEFAULT 111111111122222222223333333333.9,
|
t1 DATETIME(6) NOT NULL DEFAULT '2001-01-01 10:20:30.123456',
|
e1 ENUM('a','b') NOT NULL DEFAULT 'a'
|
);
|
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
|
Now I run these two queries:
SHOW FIELDS IN t1;
|
SHOW FIELDS IN v1;
|
Both return the same result:
+-------+---------------------+------+-----+----------------------------------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+---------------------+------+-----+----------------------------------+-------+
|
| i1 | int(11) | NO | | 0 | |
|
| i3 | bigint(20) unsigned | NO | | 18446744073709551615 | |
|
| s1 | varchar(10) | NO | | s1def | |
|
| d1 | decimal(31,1) | NO | | 111111111122222222223333333333.9 | |
|
| t1 | datetime(6) | NO | | 2001-01-01 10:20:30.123456 | |
|
| e1 | enum('a','b') | NO | | a | |
|
+-------+---------------------+------+-----+----------------------------------+-------+
|
So far so good.
Now I test mysql_list_fields() for t1 and v1.
This is the test client program:
#include <stdio.h>
|
#include <mysql/mysql.h>
|
|
static int list_fields(MYSQL *mysql, const char *table_name)
|
{
|
int i;
|
MYSQL_RES *res;
|
unsigned int field_cnt;
|
|
res= mysql_list_fields(mysql, table_name, "%");
|
if (!res)
|
{
|
printf("Error: %s\n", mysql_error(mysql));
|
return 1;
|
}
|
field_cnt= mysql_num_fields(res);
|
printf("Number of columns: %d\n", field_cnt);
|
|
for (i=0; i < field_cnt; ++i)
|
{
|
/* col describes i-th column of the table */
|
MYSQL_FIELD *col = mysql_fetch_field_direct(res, i);
|
printf ("Column[%d] name=%s type=%d charsetnr=%d def='%s'\n",
|
i, col->name, col->type, col->charsetnr, col->def);
|
}
|
mysql_free_result(res);
|
return 0;
|
}
|
|
int main(int ac, char **av)
|
{
|
MYSQL mysql;
|
mysql_init(&mysql);
|
if (!mysql_real_connect(&mysql, "localhost", "root", NULL, "test",
|
3306, "/tmp/mysql.sock", 0))
|
{
|
printf("Error: could not connect\n");
|
return 1;
|
}
|
mysql_set_character_set(&mysql, "utf8");
|
list_fields(&mysql, av[1] ? av[1] : "t1");
|
mysql_close(&mysql);
|
return 0;
|
}
|
I compile the above program and run:
Number of columns: 6
|
Column[0] name=i1 type=3 length=11 charsetnr=63 def='0'
|
Column[1] name=i3 type=8 length=20 charsetnr=63 def='18446744073709551615'
|
Column[2] name=s1 type=253 length=30 charsetnr=33 def='s1def'
|
Column[3] name=d1 type=246 length=33 charsetnr=63 def='111111111122222222223333333333.9'
|
Column[4] name=t1 type=12 length=26 charsetnr=63 def='2001-01-01 10:20:30.123456'
|
Column[5] name=e1 type=254 length=3 charsetnr=33 def='a'
|
Number of columns: 6
|
Column[0] name=i1 type=3 length=11 charsetnr=63 def='0'
|
Column[1] name=i3 type=8 length=20 charsetnr=63 def='18446744073709552000'
|
Column[2] name=s1 type=253 length=30 charsetnr=33 def='0'
|
Column[3] name=d1 type=246 length=33 charsetnr=63 def='111111111122222220000000000000'
|
Column[4] name=t1 type=12 length=26 charsetnr=63 def='20010101102030'
|
Column[5] name=e1 type=254 length=3 charsetnr=33 def='1'
|
All default values in the table are fine.
Obvervations about default values in the view:
- i1 is fine
- i3 lost precision (the 4 rightmost digits are wrong)
- s1 returned 0 instead of s1def
- d1 lost precision and lost fractional digits
- t1 lost datetime formatting and lost fractional digits
- e1 lost the original string value and returned its numeric equivalent
- blocks
-
MDEV-4912
Data type plugin API version 1
-
-
Closed
{"report":{"fcp":893,"ttfb":273.7000000476837,"pageVisibility":"visible","entityId":59601,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"56139e70-2049-4bd3-83aa-2412776c6c34","navigationType":0,"readyForUser":1070,"redirectCount":0,"resourceLoadedEnd":1225.6000000238419,"resourceLoadedStart":286.3000000715256,"resourceTiming":[{"duration":92.19999992847443,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":286.3000000715256,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":286.3000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":378.5,"responseStart":0,"secureConnectionStart":0},{"duration":92.29999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":286.60000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":286.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":378.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":139.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":286.8000000715256,"connectEnd":286.8000000715256,"connectStart":286.8000000715256,"domainLookupEnd":286.8000000715256,"domainLookupStart":286.8000000715256,"fetchStart":286.8000000715256,"redirectEnd":0,"redirectStart":0,"requestStart":286.8000000715256,"responseEnd":425.89999997615814,"responseStart":425.89999997615814,"secureConnectionStart":286.8000000715256},{"duration":200.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/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&whisper-enabled=true","startTime":287,"connectEnd":287,"connectStart":287,"domainLookupEnd":287,"domainLookupStart":287,"fetchStart":287,"redirectEnd":0,"redirectStart":0,"requestStart":287,"responseEnd":487.2000000476837,"responseStart":487.10000002384186,"secureConnectionStart":287},{"duration":203.79999995231628,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":287.2000000476837,"connectEnd":287.2000000476837,"connectStart":287.2000000476837,"domainLookupEnd":287.2000000476837,"domainLookupStart":287.2000000476837,"fetchStart":287.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":287.2000000476837,"responseEnd":491,"responseStart":491,"secureConnectionStart":287.2000000476837},{"duration":204.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":287.39999997615814,"connectEnd":287.39999997615814,"connectStart":287.39999997615814,"domainLookupEnd":287.39999997615814,"domainLookupStart":287.39999997615814,"fetchStart":287.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":287.39999997615814,"responseEnd":491.5,"responseStart":491.5,"secureConnectionStart":287.39999997615814},{"duration":204.20000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":287.60000002384186,"connectEnd":287.60000002384186,"connectStart":287.60000002384186,"domainLookupEnd":287.60000002384186,"domainLookupStart":287.60000002384186,"fetchStart":287.60000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":287.60000002384186,"responseEnd":491.8000000715256,"responseStart":491.8000000715256,"secureConnectionStart":287.60000002384186},{"duration":283.6999999284744,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":287.7000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":287.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.3999999761581,"responseStart":0,"secureConnectionStart":0},{"duration":204.40000009536743,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":287.89999997615814,"connectEnd":287.89999997615814,"connectStart":287.89999997615814,"domainLookupEnd":287.89999997615814,"domainLookupStart":287.89999997615814,"fetchStart":287.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":287.89999997615814,"responseEnd":492.3000000715256,"responseStart":492.3000000715256,"secureConnectionStart":287.89999997615814},{"duration":283.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/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":288.10000002384186,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":288.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":571.6000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":204.69999992847443,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/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":288.2000000476837,"connectEnd":288.2000000476837,"connectStart":288.2000000476837,"domainLookupEnd":288.2000000476837,"domainLookupStart":288.2000000476837,"fetchStart":288.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":288.2000000476837,"responseEnd":492.89999997615814,"responseStart":492.89999997615814,"secureConnectionStart":288.2000000476837},{"duration":503.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":289.2000000476837,"connectEnd":289.2000000476837,"connectStart":289.2000000476837,"domainLookupEnd":289.2000000476837,"domainLookupStart":289.2000000476837,"fetchStart":289.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":289.2000000476837,"responseEnd":792.6000000238419,"responseStart":792.6000000238419,"secureConnectionStart":289.2000000476837},{"duration":936.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":289.2000000476837,"connectEnd":289.2000000476837,"connectStart":289.2000000476837,"domainLookupEnd":289.2000000476837,"domainLookupStart":289.2000000476837,"fetchStart":289.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":289.2000000476837,"responseEnd":1225.6000000238419,"responseStart":1225.6000000238419,"secureConnectionStart":289.2000000476837},{"duration":276.39999997615814,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":583.2000000476837,"connectEnd":583.2000000476837,"connectStart":583.2000000476837,"domainLookupEnd":583.2000000476837,"domainLookupStart":583.2000000476837,"fetchStart":583.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":583.2000000476837,"responseEnd":859.6000000238419,"responseStart":859.6000000238419,"secureConnectionStart":583.2000000476837},{"duration":391.10000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/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&whisper-enabled=true","startTime":910.6000000238419,"connectEnd":910.6000000238419,"connectStart":910.6000000238419,"domainLookupEnd":910.6000000238419,"domainLookupStart":910.6000000238419,"fetchStart":910.6000000238419,"redirectEnd":0,"redirectStart":0,"requestStart":910.6000000238419,"responseEnd":1301.7000000476837,"responseStart":1301.7000000476837,"secureConnectionStart":910.6000000238419}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":93,"responseStart":274,"responseEnd":281,"domLoading":284,"domInteractive":1248,"domContentLoadedEventStart":1248,"domContentLoadedEventEnd":1295,"domComplete":1605,"loadEventStart":1605,"loadEventEnd":1606,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1227.3000000715256},{"name":"bigPipe.sidebar-id.end","time":1228.3000000715256},{"name":"bigPipe.activity-panel-pipe-id.start","time":1228.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.end","time":1229.3000000715256},{"name":"activityTabFullyLoaded","time":1309}],"measures":[],"correlationId":"84bbbc2a6e72e6","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":108,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Pushed into bb-10.2-ext and 10.3.