Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit 932fcf7

Browse files
committed
Move the version view off to a file individually (to split it away from set up that may include user changes), fix a warning along the way..
1 parent beff980 commit 932fcf7

File tree

4 files changed

+41
-2
lines changed

4 files changed

+41
-2
lines changed

before_setup.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ SET sql_log_bin = 0;
2020
CREATE DATABASE IF NOT EXISTS sys DEFAULT CHARACTER SET utf8;
2121

2222
USE sys;
23-
24-
CREATE OR REPLACE ALGORITHM = MERGE DEFINER = 'root'@'localhost' SQL SECURITY INVOKER VIEW version AS SELECT '1.5.0' AS sys_version, version() AS mysql_version;

sys_56.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
SOURCE ./before_setup.sql
1717

18+
SOURCE ./views/version.sql
19+
1820
SOURCE ./tables/sys_config.sql
1921
SOURCE ./tables/sys_config_data.sql
2022

sys_57.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
SOURCE ./before_setup.sql
1717

18+
SOURCE ./views/version.sql
19+
1820
SOURCE ./tables/sys_config.sql
1921
SOURCE ./tables/sys_config_data_57.sql
2022

views/version.sql

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
2+
--
3+
-- This program is free software; you can redistribute it and/or modify
4+
-- it under the terms of the GNU General Public License as published by
5+
-- the Free Software Foundation; version 2 of the License.
6+
--
7+
-- This program is distributed in the hope that it will be useful,
8+
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
-- GNU General Public License for more details.
11+
--
12+
-- You should have received a copy of the GNU General Public License
13+
-- along with this program; if not, write to the Free Software
14+
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
--
17+
-- View: version
18+
--
19+
-- Shows the sys schema and mysql versions
20+
--
21+
-- mysql> select * from sys.version;
22+
-- +-------------+---------------+
23+
-- | sys_version | mysql_version |
24+
-- +-------------+---------------+
25+
-- | 1.5.0 | 5.7.8-rc |
26+
-- +-------------+---------------+
27+
--
28+
29+
CREATE OR REPLACE
30+
DEFINER = 'root'@'localhost'
31+
SQL SECURITY INVOKER
32+
VIEW version (
33+
sys_version,
34+
mysql_version
35+
) AS
36+
SELECT '1.5.0' AS sys_version,
37+
version() AS mysql_version;

0 commit comments

Comments
 (0)