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