Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b94356ae
Commit
b94356ae
authored
Jun 03, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
parents
284144f4
f112903c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
52 deletions
+114
-52
VC++Files/client/mysqlclient.dsp
VC++Files/client/mysqlclient.dsp
+29
-0
VC++Files/zlib/zlib.dsp
VC++Files/zlib/zlib.dsp
+27
-0
libmysql/libmysql.c
libmysql/libmysql.c
+1
-51
sql-common/client.c
sql-common/client.c
+57
-1
No files found.
VC++Files/client/mysqlclient.dsp
View file @
b94356ae
...
@@ -19,6 +19,7 @@ CFG=mysqlclient - Win32 Debug
...
@@ -19,6 +19,7 @@ CFG=mysqlclient - Win32 Debug
!MESSAGE
!MESSAGE
!MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 authent" (based on "Win32 (x86) Static Library")
!MESSAGE
!MESSAGE
# Begin Project
# Begin Project
...
@@ -76,12 +77,38 @@ LIB32=xilink6.exe -lib
...
@@ -76,12 +77,38 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
!ELSEIF "$(CFG)" == "mysqlclient - Win32 authent"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "mysqlclient___Win32_authent"
# PROP BASE Intermediate_Dir "mysqlclient___Win32_authent"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "authent"
# PROP Intermediate_Dir "authent"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "MYSQL_CLIENT" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_TLS" /D "MYSQL_CLIENT" /D "NDEBUG" /D "CHECK_LICENSE" /D LICENSE=Commercial /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
# ADD LIB32 /nologo /out:"..\lib_authent\mysqlclient.lib"
!ENDIF
!ENDIF
# Begin Target
# Begin Target
# Name "mysqlclient - Win32 Release"
# Name "mysqlclient - Win32 Release"
# Name "mysqlclient - Win32 Debug"
# Name "mysqlclient - Win32 Debug"
# Name "mysqlclient - Win32 authent"
# Begin Source File
# Begin Source File
SOURCE=..\mysys\array.c
SOURCE=..\mysys\array.c
...
@@ -256,6 +283,8 @@ SOURCE=..\mysys\mf_iocache2.c
...
@@ -256,6 +283,8 @@ SOURCE=..\mysys\mf_iocache2.c
# ADD CPP /Od
# ADD CPP /Od
!ELSEIF "$(CFG)" == "mysqlclient - Win32 authent"
!ENDIF
!ENDIF
# End Source File
# End Source File
...
...
VC++Files/zlib/zlib.dsp
View file @
b94356ae
...
@@ -19,6 +19,7 @@ CFG=zlib - Win32 Debug
...
@@ -19,6 +19,7 @@ CFG=zlib - Win32 Debug
!MESSAGE
!MESSAGE
!MESSAGE "zlib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "zlib - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "zlib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "zlib - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "zlib - Win32 authent" (based on "Win32 (x86) Static Library")
!MESSAGE
!MESSAGE
# Begin Project
# Begin Project
...
@@ -75,12 +76,38 @@ LIB32=xilink6.exe -lib
...
@@ -75,12 +76,38 @@ LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\zlib.lib"
# ADD LIB32 /nologo /out:"..\lib_debug\zlib.lib"
!ELSEIF "$(CFG)" == "zlib - Win32 authent"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "zlib___Win32_authent"
# PROP BASE Intermediate_Dir "zlib___Win32_authent"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "zlib___Win32_authent"
# PROP Intermediate_Dir "zlib___Win32_authent"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /G6 /MT /W3 /O2 /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\zlib.lib"
# ADD LIB32 /nologo /out:"..\lib_release\zlib.lib"
!ENDIF
!ENDIF
# Begin Target
# Begin Target
# Name "zlib - Win32 Release"
# Name "zlib - Win32 Release"
# Name "zlib - Win32 Debug"
# Name "zlib - Win32 Debug"
# Name "zlib - Win32 authent"
# Begin Source File
# Begin Source File
SOURCE=.\adler32.c
SOURCE=.\adler32.c
...
...
libmysql/libmysql.c
View file @
b94356ae
...
@@ -616,60 +616,10 @@ mysql_connect(MYSQL *mysql,const char *host,
...
@@ -616,60 +616,10 @@ mysql_connect(MYSQL *mysql,const char *host,
#endif
#endif
#ifdef CHECK_LICENSE
/*
Check server side variable 'license'.
If the variable does not exist or does not contain 'Commercial',
we're talking to non-commercial server from commercial client.
SYNOPSIS
check_license()
RETURN VALUE
0 success
!0 network error or the server is not commercial.
Error code is saved in mysql->net.last_errno.
*/
static
int
check_license
(
MYSQL
*
mysql
)
{
MYSQL_ROW
row
;
MYSQL_RES
*
res
;
NET
*
net
=
&
mysql
->
net
;
static
const
char
query
[]
=
"SELECT @@license"
;
static
const
char
required_license
[]
=
STRINGIFY_ARG
(
LICENSE
);
if
(
mysql_real_query
(
mysql
,
query
,
sizeof
(
query
)
-
1
))
{
if
(
net
->
last_errno
==
ER_UNKNOWN_SYSTEM_VARIABLE
)
{
net
->
last_errno
=
CR_WRONG_LICENSE
;
sprintf
(
net
->
last_error
,
ER
(
net
->
last_errno
),
required_license
);
}
return
1
;
}
if
(
!
(
res
=
mysql_use_result
(
mysql
)))
return
1
;
row
=
mysql_fetch_row
(
res
);
/*
If no rows in result set, or column value is NULL (none of these
two is ever true for server variables now), or column value
mismatch, set wrong license error.
*/
if
(
!
net
->
last_errno
&&
(
!
row
||
!
row
[
0
]
||
strncmp
(
row
[
0
],
required_license
,
sizeof
(
required_license
))))
{
net
->
last_errno
=
CR_WRONG_LICENSE
;
sprintf
(
net
->
last_error
,
ER
(
net
->
last_errno
),
required_license
);
}
mysql_free_result
(
res
);
return
net
->
last_errno
;
}
#endif
/* CHECK_LICENSE */
/**************************************************************************
/**************************************************************************
Change user and database
Change user and database
**************************************************************************/
**************************************************************************/
int
cli_read_change_user_result
(
MYSQL
*
mysql
,
char
*
buff
,
const
char
*
passwd
)
int
cli_read_change_user_result
(
MYSQL
*
mysql
,
char
*
buff
,
const
char
*
passwd
)
{
{
NET
*
net
=
&
mysql
->
net
;
NET
*
net
=
&
mysql
->
net
;
...
...
sql-common/client.c
View file @
b94356ae
...
@@ -751,6 +751,58 @@ static my_bool is_NT(void)
...
@@ -751,6 +751,58 @@ static my_bool is_NT(void)
}
}
#endif
#endif
#ifdef CHECK_LICENSE
/*
Check server side variable 'license'.
If the variable does not exist or does not contain 'Commercial',
we're talking to non-commercial server from commercial client.
SYNOPSIS
check_license()
RETURN VALUE
0 success
!0 network error or the server is not commercial.
Error code is saved in mysql->net.last_errno.
*/
static
int
check_license
(
MYSQL
*
mysql
)
{
MYSQL_ROW
row
;
MYSQL_RES
*
res
;
NET
*
net
=
&
mysql
->
net
;
static
const
char
query
[]
=
"SELECT @@license"
;
static
const
char
required_license
[]
=
STRINGIFY_ARG
(
LICENSE
);
if
(
mysql_real_query
(
mysql
,
query
,
sizeof
(
query
)
-
1
))
{
if
(
net
->
last_errno
==
ER_UNKNOWN_SYSTEM_VARIABLE
)
{
net
->
last_errno
=
CR_WRONG_LICENSE
;
sprintf
(
net
->
last_error
,
ER
(
net
->
last_errno
),
required_license
);
}
return
1
;
}
if
(
!
(
res
=
mysql_use_result
(
mysql
)))
return
1
;
row
=
mysql_fetch_row
(
res
);
/*
If no rows in result set, or column value is NULL (none of these
two is ever true for server variables now), or column value
mismatch, set wrong license error.
*/
if
(
!
net
->
last_errno
&&
(
!
row
||
!
row
[
0
]
||
strncmp
(
row
[
0
],
required_license
,
sizeof
(
required_license
))))
{
net
->
last_errno
=
CR_WRONG_LICENSE
;
sprintf
(
net
->
last_error
,
ER
(
net
->
last_errno
),
required_license
);
}
mysql_free_result
(
res
);
return
net
->
last_errno
;
}
#endif
/* CHECK_LICENSE */
/**************************************************************************
/**************************************************************************
Shut down connection
Shut down connection
**************************************************************************/
**************************************************************************/
...
@@ -1996,10 +2048,14 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
...
@@ -1996,10 +2048,14 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
goto
error
;
goto
error
;
}
}
if
(
client_flag
&
CLIENT_COMPRESS
)
/* We will use compression */
if
(
client_flag
&
CLIENT_COMPRESS
)
/* We will use compression */
net
->
compress
=
1
;
net
->
compress
=
1
;
#ifdef CHECK_LICENSE
if
(
check_license
(
mysql
))
goto
error
;
#endif
if
(
db
&&
mysql_select_db
(
mysql
,
db
))
if
(
db
&&
mysql_select_db
(
mysql
,
db
))
goto
error
;
goto
error
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment