Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29191

Use statx/btime instead of stat/ctime for CREATE_DATE where available

    XMLWordPrintable

Details

    Description

      Currently the CREATE_TIME column in SHOW TABLE STATUS output and in INFORMATION_SCHEMA.TABLES is populated from file system ctime information returned by the stat() system call.

      ctime does not really contain a files creation time, but rather the last time the files metadata got changed. As this is often not changed after a file got created it may show the creation time, but it is not guaranteed.

      Newer file systems like e.g. ext4 add another time field for the actual creating time, often also named birth time / btime. This additional field is available via the newer statx() variant of the classic stat() system call.

      So the feature request is to use statx() instead of stat() where it is available, and to populate CREATE_TIME with the btime value if set, and to only fall back to ctime where btime is not available.

      See also e.g.: https://man7.org/linux/man-pages/man2/statx.2.html

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hholzgra Hartmut Holzgraefe
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.