sql 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. #------------------------------------------------------------------------------
  2. # $File: sql,v 1.21 2017/03/17 21:35:28 christos Exp $
  3. # sql: file(1) magic for SQL files
  4. #
  5. # From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
  6. # Recognize some MySQL files.
  7. # Elan Ruusamae <glen@delfi.ee>, added MariaDB signatures
  8. # from https://bazaar.launchpad.net/~maria-captains/maria/5.5/view/head:/support-files/magic
  9. #
  10. 0 beshort 0xfe01 MySQL table definition file
  11. >2 byte x Version %d
  12. >3 byte 0 \b, type UNKNOWN
  13. >3 byte 1 \b, type DIAM_ISAM
  14. >3 byte 2 \b, type HASH
  15. >3 byte 3 \b, type MISAM
  16. >3 byte 4 \b, type PISAM
  17. >3 byte 5 \b, type RMS_ISAM
  18. >3 byte 6 \b, type HEAP
  19. >3 byte 7 \b, type ISAM
  20. >3 byte 8 \b, type MRG_ISAM
  21. >3 byte 9 \b, type MYISAM
  22. >3 byte 10 \b, type MRG_MYISAM
  23. >3 byte 11 \b, type BERKELEY_DB
  24. >3 byte 12 \b, type INNODB
  25. >3 byte 13 \b, type GEMINI
  26. >3 byte 14 \b, type NDBCLUSTER
  27. >3 byte 15 \b, type EXAMPLE_DB
  28. >3 byte 16 \b, type CSV_DB
  29. >3 byte 17 \b, type FEDERATED_DB
  30. >3 byte 18 \b, type BLACKHOLE_DB
  31. >3 byte 19 \b, type PARTITION_DB
  32. >3 byte 20 \b, type BINLOG
  33. >3 byte 21 \b, type SOLID
  34. >3 byte 22 \b, type PBXT
  35. >3 byte 23 \b, type TABLE_FUNCTION
  36. >3 byte 24 \b, type MEMCACHE
  37. >3 byte 25 \b, type FALCON
  38. >3 byte 26 \b, type MARIA
  39. >3 byte 27 \b, type PERFORMANCE_SCHEMA
  40. >3 byte 127 \b, type DEFAULT
  41. >0x0033 ulong x \b, MySQL version %d
  42. 0 belong&0xffffff00 0xfefe0500 MySQL ISAM index file
  43. >3 byte x Version %d
  44. 0 belong&0xffffff00 0xfefe0600 MySQL ISAM compressed data file
  45. >3 byte x Version %d
  46. 0 belong&0xffffff00 0xfefe0700 MySQL MyISAM index file
  47. >3 byte x Version %d
  48. >14 beshort x \b, %d key parts
  49. >16 beshort x \b, %d unique key parts
  50. >18 byte x \b, %d keys
  51. >28 bequad x \b, %lld records
  52. >36 bequad x \b, %lld deleted records
  53. 0 belong&0xffffff00 0xfefe0800 MySQL MyISAM compressed data file
  54. >3 byte x Version %d
  55. 0 belong&0xffffff00 0xfefe0900 MySQL Maria index file
  56. >3 byte x Version %d
  57. 0 belong&0xffffff00 0xfefe0a00 MySQL Maria compressed data file
  58. >3 byte x Version %d
  59. 0 belong&0xffffff00 0xfefe0c00
  60. >4 string MACF MySQL Maria control file
  61. >>3 byte x Version %d
  62. 0 string \376bin MySQL replication log,
  63. >9 long x server id %d
  64. >8 byte 1
  65. >>13 long 69 \b, MySQL V3.2.3
  66. >>>19 string x \b, server version %s
  67. >>13 long 75 \b, MySQL V4.0.2-V4.1
  68. >>>25 string x \b, server version %s
  69. >8 byte 15 MySQL V5+,
  70. >>25 string x server version %s
  71. >4 string MARIALOG MySQL Maria transaction log file
  72. >>3 byte x Version %d
  73. #------------------------------------------------------------------------------
  74. # iRiver H Series database file
  75. # From Ken Guest <ken@linux.ie>
  76. # As observed from iRivNavi.iDB and unencoded firmware
  77. #
  78. 0 string iRivDB iRiver Database file
  79. >11 string >\0 Version %s
  80. >39 string iHP-100 [H Series]
  81. #------------------------------------------------------------------------------
  82. # SQLite database files
  83. # Ken Guest <ken@linux.ie>, Ty Sarna, Zack Weinberg
  84. #
  85. # Version 1 used GDBM internally; its files cannot be distinguished
  86. # from other GDBM files.
  87. #
  88. # Version 2 used this format:
  89. 0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
  90. # Version 3 of SQLite allows applications to embed their own "user version"
  91. # number in the database at offset 60. Later, SQLite added an "application id"
  92. # at offset 68 that is preferred over "user version" for indicating the
  93. # associated application.
  94. #
  95. 0 string SQLite\ format\ 3 SQLite 3.x database
  96. !:mime application/x-sqlite3
  97. # seldom found extension sqlite3 like in SyncData.sqlite3
  98. # db
  99. # Avira Antivir use extension "dbe" like in avevtdb.dbe, avguard_tchk.dbe
  100. # Unfortunately extension sqlite also used for other databases starting with string
  101. # "TTCONTAINER" like in tracks.sqlite contentconsumer.sqlite contentproducerrepository.sqlite
  102. # and with string "ZV-zlib" in like extra.sqlite
  103. !:ext sqlite/sqlite3/db/dbe
  104. >60 belong =0x5f4d544e (Monotone source repository)
  105. >68 belong =0x0f055112 (Fossil checkout)
  106. >68 belong =0x0f055113 (Fossil global configuration)
  107. >68 belong =0x0f055111 (Fossil repository)
  108. >68 belong =0x42654462 (Bentley Systems BeSQLite Database)
  109. >68 belong =0x42654c6e (Bentley Systems Localization File)
  110. >68 belong =0x47504b47 (OGC GeoPackage file)
  111. >68 default x
  112. >>68 belong !0 \b, application id %u
  113. >>60 belong !0 \b, user version %d
  114. >96 belong x \b, last written using SQLite version %d
  115. # SQLite Write-Ahead Log from SQLite version >= 3.7.0
  116. # http://www.sqlite.org/fileformat.html#walformat
  117. 0 belong&0xfffffffe 0x377f0682 SQLite Write-Ahead Log,
  118. !:ext sqlite-wal/db-wal
  119. >4 belong x version %d
  120. # SQLite Rollback Journal
  121. # http://www.sqlite.org/fileformat.html#rollbackjournal
  122. 0 string \xd9\xd5\x05\xf9\x20\xa1\x63\xd7 SQLite Rollback Journal
  123. # Panasonic channel list database svl.bin or svl.db added by Joerg Jenderek
  124. # https://github.com/PredatH0r/ChanSort
  125. 0 string PSDB\0 Panasonic channel list DataBase
  126. !:ext db/bin
  127. #!:mime application/x-db-svl-panasonic
  128. >126 string SQLite\ format\ 3
  129. #!:mime application/x-panasonic-sqlite3
  130. >>&-15 indirect x \b; contains
  131. # H2 Database from http://www.h2database.com/
  132. 0 string --\ H2\ 0.5/B\ --\ \n H2 Database file