File: startup-message.patch

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (68 lines) | stat: -rw-r--r-- 2,841 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From: Otto Kekalainen <otto@debian.org>
Date: Sun, 10 Mar 2024 16:56:13 +0000
Subject: Show banner in server and client startup to drive community
 engagement

Suggest to users that they can support MariaDB development by simply giving a
star on GitHub. This patch experiments with how well such a banner works, and
may later change the contents to drive some other kind of engagement.

Client output:

    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 17
    Server version: 11.8.1-MariaDB-5 from Debian -- Please help get to 10k stars at https://github.com/MariaDB/Server

    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

    MariaDB [(none)]>

Server output:
    [Note] Please help get to 10k stars at https://github.com/MariaDB/Server

Server output if built in git directory:
    [Note] Starting MariaDB 11.8.1-MariaDB-5 from Debian source revision 1a9c3debfd6b1b16af4e501d3530b866b85c38a8 server_uid eNAjF8/wvUNM09/mSmh+k3a5o5w= as process 1359

Logs will also show as server output:
    mysqld: Version: '11.8.1-MariaDB-5 from Debian'  socket: '/run/mysqld/mysqld.sock'  port: 3306  -- Please help get to 10k stars at https://github.com/MariaDB/Server

Forwarded: no
---
 sql/mysqld.cc | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 31371bf..4d59e94 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5041,13 +5041,23 @@ static int init_server_components()
 
   /*
     Print source revision hash, as one of the first lines, if not the
-    first in error log, for troubleshooting and debugging purposes
+    first in error log, for troubleshooting and debugging purposes.
+    If not, suggest database admin to help project by giving a star
+    on GitHub.
   */
   if (!opt_help)
-    sql_print_information("Starting MariaDB %s source revision %s "
-                          "server_uid %s as process %lu",
-                          server_version, SOURCE_REVISION, server_uid,
-                          (ulong) getpid());
+    if (SOURCE_REVISION) {
+      sql_print_information("Starting MariaDB %s source revision %s "
+                            "server_uid %s as process %lu",
+                            server_version, SOURCE_REVISION, server_uid,
+                            (ulong) getpid());
+    } else {
+      sql_print_information("Starting MariaDB %s server_uid %s "
+                            "as process %lu",
+                            server_version, server_uid, (ulong) getpid());
+      sql_print_information("Please help get to 10k stars at "
+                            "https://github.com/MariaDB/server");
+    }
 
 #ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
   /*